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

How should i make this script? (ANSWERED) [closed]

Asked by 9 years ago

Ok. so i learned how to make a block. once you click it, it disapears. u click is again. it appears. but i want to make a block. where when u click it it deletes. not temperary disappears. i know i have to add click detector and a script. but whats in the script????~~~~~~~~~~~~~~~~~

function onClicked() script.Parent.Parent.part.Transparency=1 script.Parent.Parent.part.CanCollide=false end script.Parent.ClickDetector.MouseClick:connect(onClicked)

~~~~~~~~~~~~~~~~~

problem : I dont want to click it again!!!!

0
May we see you're attempt? I know you'll need the :Destroy() method to remove it. M39a9am3R 3210 — 9y

Locked by Shawnyg, Perci1, ImageLabel, and M39a9am3R

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

2 answers

Log in to vote
1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

To remove it completely, you need to use the Destroy method.

script.Parent.ClickDetector.MouseClick:connect(function()
    script.Parent.Parent.part:Destroy()
end)

Make sure the line 2 path leads to the correct part!

0
Thanks! it worked! legoson7 70 — 9y
0
No problem. Shawnyg 4330 — 9y
Ad
Log in to vote
0
Answered by 9 years ago
script.Parent.ClickDetector.MouseClick:connect(function()
    script.Parent.Parent.PARTNAMEHERE:Destroy()
end)