Script not teleporting player to the map anyone know why?
Okay so it works with the one player (the piggy) teleporting to the waiting area but the player doesnt go anywhere and i retyped the code 3 different times. here is the line of code that im talking about:
01 | function module.TeleportPlayers(players, mapspawns) |
02 | for i, player in pairs (players) do |
03 | local character = player.Character |
05 | if character:FindFirstChild( "HumanoidRootPart" ) then |
07 | player.Character.Humanoid.WalkSpeed = 16 |
09 | local rand = Random.new() |
10 | player.Character.HumanoidRootPart.CFrame = mapspawns [ rand.NextInteger( 1 ,#mapspawns) ] .CFrame + Vector 3. new( 0 , 10 , 0 ) |
Please let me know if you know how to fix this.