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

How do I make a certain team click block?

Hello, I want a make a game that only certain teams can click a block and when they do it destroy it (I have no clue how to do this and I suck at scripting!!)

1 answer

✓ Accepted answer

Start by putting a ClickDetector inside a Part. (Info on ClickDetector): https://wiki.roblox.com/index.php?title=ClickDetector Then we insert a script inside the Part, and put this script in it:

script.Parent.ClickDetector.MouseClick:Connect(function(Player)
	if Player.Team.Name == "" then -- Team name here
		script.Parent:Destroy()
	end 
end)

Here's how it works: Script activates when the ClickDetector inside the Part is clicked. The event MouseClickwill also give us the Player who clicked the ClickDetector. Then the script will check if the Player is in a certain team. And if the Player is in the team, the part will be destroyed with the function :Destroy().

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