I am making a fashion show and I want it to be that if I kill someone they spawn at a specific spawnlocation. Is there a way/script that puts someone in a team when they die? Can anyone help me with this? (I am a beginner at Roblox studio)
COMMUNITY QUESTION
Can I make it that if I kill someone, they spawn at a specific spawnlocation?
2 answers
You can either use teams to set someone's spawn when they die, or just teleport them when they respawn with CharacterAdded.
local function CharacterAddedFunction(character)
local humanoidrootpart = character:WaitForChild("HumanoidRootPart")
humanoidrootpart.CFrame = workspace.TargetSpawnPoint.CFrame
end
game.Players.PlayerAdded:Connect(function(player)
local character = plr.Character
if character then -- initial check
CharacterAddedFunction(character)
end
plr.CharacterAdded:Connect(CharacterAddedFunction)
end)
inside a local player (inside game.Players) there is a property called respawn location. You can set the object value to any brick.
1 comment
0
so game.players.localplayer.respawnlocation = workspace.spawnlocation
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
How do you make it that if someone die they join a specific team, that's what I'm trying to figure out