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

How do I make a certain team click block?

Asked by 6 years ago

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

Log in to vote
0
Answered by 6 years ago

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().

Ad

Answer this question