What? What does this means?
You can't pass a loop value in another loop value, that's the "pairs" and "ipairs" rules, and those floating pos1-5 variables? Not even in a table?
And what about this: .Character:MoveTo(Pos1,Pos2,Pos3,Pos4,Pos5)
o.o
What you need to do is, first make a table which contains every position, define it like this
Pos1 = Vector3.new(-48, 4.5, -108.6)
Pos2 = Vector3.new(-49, 4.5, -108.6)
Pos3 = Vector3.new(-50, 4.5, -108.6)
Pos4 = Vector3.new(-8, 4.5, -108.6)
Pos5 = Vector3.new(-18, 4.5, -108.6)
local spawns = {Pos1, Pos2, Pos3, Pos4, Pos5}
Now you need to create the function, I don't know where to be called because I don't know your intentions, that's all your own:
function spawnPlayers()
local passedPlayers = 0
for _, player in pairs(game.Players:GetChildren()) do
player.Position = #spawns - passedPlayer
passedPlayers = passedPlayers + 1
end
end
That should work, this means that each player will be spawned in each spawn, as the rule says: 1 player = 1 spawn =)
Ps: I'm tired, the passedPlayers part may not work!
1 comment
Teleport All Players To Different Positions Each One