RespawnLocation broken?

Keep in mind the following here as you read this post:

  • The code is entirely server-sided, I am not changing the RespawnLocation on the client
  • I am confirming by looking in Explorer on Studio, printing out the RespawnLocation that it is being assigned correctly and not staying nil.
  • I manually set the RespawnLocation. player.RespawnLocation = workspace.SpawnLocation for example.

Problem: RespawnLocation will not work, player won’t respawn at the spawn locations I specified even though it correctly assigns it.

I am not sure if I am doing something wrong or if this is a bug so I am looking for some help here.

I’m not sure what good will my code do to this post since all I am doing is just something along the lines of:

player.RespawnLocation = workspace.Map.SpawnLocations.ExampleSpawnLocation
-- yeah that's it

EDIT: Ok for some reason, it worked on a random test file when I just plainly set the RespawnLocation yet it did not actually work in the real game. I am setting RespawnLocation from a random map that is being loaded into the game that has a descendant model called SpawnLocations, anyway I might be doing something wrong? If code is needed, let me know though I am just literally grabbing SpawnLocation from a descendant model that is placed into workspace which wouldn’t be that hard to visualize.

1 Like

Try:

game.Players.PlayerAdded:Connect(function(player)
    player:WaitForChild("Character").Humanoid.Died:Connect(function()
    -- Player has died (health = 0)
    repeat wait() until player.Character -- wait for new character so no error 
    player.Character.HumanoidRootPart.Position = workspace.LocationName.Position + Vector3.new(0,2,0) -- spawn at location 2 studs above
    end)
end)

Note: Only using the teams service can you set an automatic respawn. (Assigning a SpawnLocation to a team colour)

9 posts were split to a new topic: RespawnLocation broken? (Private Discussion)

The canonical method is to use CharacterAdded event on the player. It is usually reliable for knowing that the character always exist about all, if not, most of the time.

Root topic of the bug.

Please consider using alternate manual spawning methods before the bug is resolved. This bug is approximately almost two years old.


Just some further digging:

3 Likes

Though I guess there are multiple spawnLocations for Neutral, the spawnLocation I tried to use that is correlated to this problem meets the criteria of the RespawnLocation page, I guess I’ll have to go for a custom approach, thank you for the post. Seems like the player just picks a default SpawnLocation and will never be able to override it with a different also neutral SpawnLocation to me.

1 Like