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!!)
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 MouseClick
will 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()
.