Workspace.BotSphere.FloatToPoint:81: invalid argument #2 to 'random' (interval is empty)

 Workspace.BotSphere.FloatToPoint:81: invalid argument #2 to 'random' (interval is empty)
while task.wait(2) do
	characters = workspace.CharactersInGame:GetChildren()
	character = characters[math.random(1, #characters)]
	root = character:WaitForChild("HumanoidRootPart")
	module.MoveTo(script.Parent, root)
	print("move")
end

Try adding a check if #characters > 0 then, I’m pretty sure thats the problem.

1 Like