Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can I make it that if I kill someone, they spawn at a specific spawnlocation?

Asked by 4 years ago
Edited 4 years ago

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)

2 answers

Log in to vote
0
Answered by 4 years ago

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)
0
How do you make it that if someone die they join a specific team, that's what I'm trying to figure out DudeHyper321 17 — 4y
Ad
Log in to vote
0
Answered by
A_Mp5 222 Moderation Voter
4 years ago

inside a local player (inside game.Players) there is a property called respawn location. You can set the object value to any brick.

0
so game.players.localplayer.respawnlocation = workspace.spawnlocation DudeHyper321 17 — 4y

Answer this question