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

i have had trouble with making a block disappear and be removed after 10 clicks?

Asked by 4 years ago

hi i have recently been trying to make a block disappear after being clicked 10 times but i just cant do it. i am new to roblox scripts so i cant really do this. can someone help?

0
At least try to attempt some sort of code, do this by finding specific Google documents or questions asked previously. This site isn't a request site. RyanTheLion911 195 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

So, create a ClickDetector in the block firstly. This will let us click the block. Then, you will want to create a script in the block with this script

local clicks = 0
local MaxClicks = 10 -- Amount of clicks before dissapering

script.Parent.ClickDetector.MouseClick:Connect(function()
    clicks = clicks + 1
    if clicks == MaxClicks then
        script.Parent:Destroy()
    end
end)
0
Don't give scripts to people who haven't tried, this is not a request site. mixgingengerina10 223 — 4y
Ad

Answer this question