Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

2 comments

0

Put the whole script inside a Code block

0

Check what their team is when the function runs.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.