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

How do I make it so that a script will only activate if a certain team touches it?

Asked by 10 years ago

So I have a script for a brick, that will only work when a player touches it. However, I only want the script to work if a certain team touches it. I wanted the Prisoners to be the only ones who could use it. (The teams are Prisoners, Guards, and Neutral, if you need that info) I'm not requesting anything, I just wanted to see if someone could tell me how to do it, if they couldn't be bothered to do it themselves.

1 answer

Log in to vote
0
Answered by 10 years ago

all you need to do is add in an if statement to check what their team color is. so in pseudo code: if game.Players:FindFirstChild(HIT.Parent.Name).TeamColor == "[TEAMCOLOR]" then -- rest of code

0
Awesome. Thanks :D Tallestmidget7 95 — 10y
Ad

Answer this question