Err...
First of all, you should probably do this instead:
for _, player in pairs(game:GetService("Players"):GetPlayers()) do
end
And perhaps this shall help you.
local Players = game:GetService("Players")
local PlayerTable = {}
local NextEntryNumber = #PlayerTable + 1
while true do
PlayerTable = {}
for _, player in pairs(Players:GetPlayers()) do
PlayerTable[NextEntryNumber] = player
end
wait(5)
end
local NumPlayers = #PlayerTable
local PickerOne = math.random(NumPlayers)
local PickerTwo = math.random(NumPlayers)
for i = 1, 3 do
if PickerOne == PickerTwo then
PickerTwo = math.random(NumPlayers)
end
end
local andthewinneris = PlayerTable[PickerOne]
local andtherunnerup = PlayerTable[PickerTwo]
andthewinneris.Character.HumanoidRootPart.CFrame = TPBrick1.CFrame
andtherunnerup.Character.HumanoidRootPart.CFrame = TPBrick2.CFrame
The script above will pick two random players from the game and teleport them to TPBrick1 and TPBrick2, respectively.
If this is not what you're looking for, please comment on my answer and tell me the condition you want the players to be teleported with.
1 comment
wth are you trying to do?