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

How do I make this script apply to only a certain team?

Asked by
par1d 19
4 years ago

I would like this ragdoll death animation script to only apply for a certain team, how would I do this?

Here is the script:

game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) script.RagdollClient:Clone().Parent = character

    character:WaitForChild("Humanoid").Died:connect(function()
        character.UpperTorso:SetNetworkOwner(player)
    end)
end)

end)

0
Put the whole script inside a Code block karlo_tr10 1233 — 4y
0
Check what their team is when the function runs. DeceptiveCaster 3761 — 4y

1 answer

Log in to vote
0
Answered by
Joshument 110
4 years ago

Each player has two properties, Team and TeamColor. TeamColor is what you would use to determine the brickcolor of a team, i.e. "Really Red", whereas Team is for the exact name, i.e. "Ingame"

You can check with an if statment as follows:

if Player.Team == "Ingame" then
    --Code
end
Ad

Answer this question