I'm trying to make my script teleport the user to all players via a while true do loop, but unfortunately it does nothing except output attempt to get length of local 'v' (a userdata value)
local lp = game.Players.LocalPlayer
wait(3)
for _,v in pairs(game.Players:GetChildren()) do
if game:GetService("Players")[v.Name] and game:GetService("Players")[v.Name].Character then
while true do
local randomplayer = math.random(1,#v)
lp.Character.HumanoidRootPart.CFrame = game:GetService("Players")[v.Name].Character.HumanoidRootPart.CFrame
wait(1)
end
end
end
What did I do wrong?

4 comments
You probably want to use remote events.
I just edited it to make it work a little better.
Works good, thanks my man!
Of course! Always happy to help!