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

How to make clients respawn at a planned location when they died?

Good day everyone, sorry if I spoiled something with this question So how can I make people respawn at a place when they died

This is what I have:

SpawnLocation (When the player joins, they spawn here)

Another SpawnLocation (They respawn here when they died)

Script(You'll help me with this script!)

And please tell me if im missing some things or make it better

So it's like every gta games they died and respawn at the hospital

Thank you:)

2 comments

0

Scripting helpers is not a request site.

1

at least try man

1 answer

So i made a simple script that makes what you requested (i will explain)

local RegularSpawn = game.Workspace.RegularSpawn -- or what ever the name
local AfterResetSpawn = game.Workspace.AfterResetSpawn-- or what ever the name

game.Players.PlayerAdded:Connect(function(Player)
	Player.RespawnLocation = RegularSpawn
	Player.CharacterAdded:Connect(function(Character)
		Character.Humanoid.Died:Connect(function()
			Player.RespawnLocation = AfterResetSpawn
		end)
	end)
end)

Explanation: each player has a property that is called RespawnLocation so we can change with a script baesd on what we want

when the player joins we set the location to the regular location when the player dies we set the location to AfterRest location Simple if you don't understand something in this script you can ask in the comments

Note: don't forget to name the SpawnLocations in Correct names

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