Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I go about of making respawnable spots?

So I am making my own round-based game. The problem is that if a player dies, they can't go back to the map.

I thought of making a LocalScript tell the server that the player has respawned and teleport them to the map but I have no clue if that is going to work, considering if the LocalScript knows there is a map or not.

Instead I could have a RemoteFunction that tells the client if there is a map or not, then the client can ask the server to teleport them. But I'm not sure if that is going to work to.

This seems like a simple question but I'm not able to come up with ideas.

Edit: I thought of a new idea to use SpawnLocations, but I've used them in the past and they are a little hard to work with.

2 comments

0

Use teams and spawns.

0

Is there a better method? I used that in my previous project and it got messy with all the spawn locations and teams

1 answer

✓ Accepted answer

Add Folder into the map then add Parts and Name them SpawnTeamNumber

local Players = game.Players:GetChildren()
local Map = workspace:WaitForChild(“Map”) -- Change this to the name of ur map
local Spawns = Map:WaitForChild(“Spawns”)

Players.PlayerAdded:Connect(function(Player)
       Player.CharacterAdded:Connect(function()
              local Spawn = math.random(1,Amount of Spawn)
              Player.Character.HumanoidRootPart.CFrame = Spawns[“Spawn”.. Player.Team.Name ..Spawn].CFrame
       end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.