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

How to make an item work against only one group/team?

I was wondering how I could get a specific item to work against only one specific team. I'm trying to get tasers, only used by police, to work only against criminals. Both Police and Criminals are teams. Plus, how can I make that item teleport only one team (criminals) to a specific spot (jail)?

Sorry, I have the code on my other computer and I think I may have deleted what I have.

1 answer

Anti-Teamkill scripts are pretty simple to do. Every weapon will have some sort of section of code on what to do when you hit someone. In that block, just compare your team and the person you hit's team.

if yourPlayer.TeamColor ~= personYouHit.TeamColor then
	--damage them
end

GetPlayerFromCharacter will likely come in handy.

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