01 | game.Players.PlayerAdded:connect( function (player) |
02 | player.CharacterAdded:connect( function (character) |
03 | local spawns = mapChosenClone.Spawns:GetChildren() |
04 | for i,v in pairs (game.Players:GetPlayers()) do --Problem |
05 | local name = v.Name |
06 | local check = game.Workspace:FindFirstChild(name) |
07 | if check then |
08 | local checkHumanoid = check:FindFirstChild( "Humanoid" ) |
09 | if checkHumanoid then |
10 | check:MoveTo(spawns [ i ] .Position) |
11 | end |
12 | end |
13 | end |
14 | end ) |
15 | end ) |
When the player respawns the player doesn't teleport. I'm pretty sure its the line where I put the comment. This is probably a stupid mistake but I forget things.
Please do not hate me if this does not work p.p
01 | game.Players.PlayerAdded:connect( function (player) |
02 | player.CharacterAdded:connect( function (character) |
03 | local spawns = mapChosenClone.Spawns:GetChildren() |
04 | for i,v in pairs (game.Players:GetPlayers()) do --Problem |
05 | local name = v.Name |
06 | local check = game.Workspace:FindFirstChild(name) |
07 | if check then |
08 | local checkHumanoid = check:FindFirstChild( "Humanoid" ) |
09 | if checkHumanoid then |
10 | check.Parent.Torso.CFrame = CFrame.new(spawns [ i ] .Position) |
11 | end |
12 | end |
13 | end |
14 | end ) |
15 | end ) |
Because move to makes the humanoid 'walk to the position'. Set the CFrame of the torso.
01 | game.Players.PlayerAdded:connect( function (player) |
02 | player.CharacterAdded:connect( function (character) |
03 | local spawn = mapChosenClone.Spawns:GetChildren() |
04 | for i,v in pairs (game.Players:GetPlayers()) do --Problem |
05 | local name = v.Name |
06 | local check = game.Workspace:FindFirstChild(name) |
07 | if check then |
08 | local checkHumanoid = check:FindFirstChild( "Humanoid" ) |
09 | if checkHumanoid then |
10 | check:MoveTo(spawns [ i ] .Position) |
11 | end |
12 | end |
13 | end |
14 | end ) |
15 | end ) |
Hopefully this should work!