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)
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