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

How do I make this script run on Player Respawn instead of just when the first join the game?

Asked by 5 years ago

As the title states, I want to make this script run on Player Respawn instead of just when they join the game, can't see to work out how.

game.Players.PlayerAdded:Connect(function(plr)
    if  plr:GetRankInGroup(Army) == 255 then --- Field Marshal
        plr.PlayerGui.SpawnGui.MainFrame.Kit.Ranks.FM.ArmGiverL.Disabled = false
        plr.PlayerGui.SpawnGui.MainFrame.Kit.Ranks.FM.ArmGiverR.Disabled = false
    end
end)
0
try plr.CharacterAdded theCJarmy7 1293 — 5y

1 answer

Log in to vote
0
Answered by
Rhidlor 42
5 years ago

The CharacterAdded event will fire everytime a Player's character spawns initially or respawns. https://wiki.roblox.com/index.php?title=API:Class/Player/CharacterAdded

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        --Code inside here will run when player "respawns"
    end)
end)
Ad

Answer this question