RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Loop bey going to another bey if they hit break loop"
-- local script local Player = game:GetService("Players").LocalPlayer local character = Player.Character or Player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local breakLoop = false local function onTouch(part) local otherParent = part.Parent local otherHumanoid = otherParent:FindFirstChildWhichIsA("Humanoid") if otherHumanoid and part.Name == "BreakLoop" then breakLoop = true end end character.HumanoidRootPart.Touched:Connect(onTouch) while not breakLoop do local beys = game.Workspace.Beyblades:GetChildren() local currentBey = beys[math.random(1, #beys)] humanoid:MoveTo(currentBey.PrimaryPart.Position) humanoid.MoveToFinished:Wait() wait(1) end