I only need ONE RANDOM player to be moved/teleported to a area instead of all players
while true do wait() for i,v in pairs(game.Players:GetChildren()) do v.Character:MoveTo(Vector3.new(-359.5, 291, 88.5)) end wait(30) end
Well, to get a random player you need to get a random number. Then, since GetPlayers()
returns a table, you can use that random number to get a player off of that table.
local players = game.Players:GetPlayers() local randomNumber = math.random(1, #players) local randomPlayer = players[randomNumber] randomPlayer.Character:MoveTo(Vector3.new(-359.5, 291, 88.5))
Try something like this:
while true do list = game.Players:GetChildren() victim = list[math.random(1, #list)] victim.Character.MoveTo(Vector3.new(-359.5, 291, 88.5)) wait(30) end