How to find players spawn location?

Hey devs,

I am making a Teleport GUI that sends the player to a PVP location in the map. That is pretty simple to do, but I cannot seem to figure out how to find their respawn locaiton.

My game uses teams; Starts the player off on a blank team, where they then decide which team to join. After joining a team, they will respawn in their teams base.

I am assuming that I will have to check what team the player is on, then type the code paths to find the respawn location in the teams base; then teleport them to that location?

^ That is my current plan; But I just wanted to make this post to see if there was a better way to find where the player will respawn at. I am not sure if there a value on the player or the character somewhere that controls where they respawn, so that is what I am looking for.

1 Like

I added this into my GUI script:

button.MouseButton1Click:Connect(function()

	print(player.RespawnLocation)

end)

image

Since it is nil, the player will appear at any SpawnLocation, you can change it by giving it a value:

Player.RespawnLocation = -- SpawnLocation