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

How should i make this script? (ANSWERED)

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!!!!

1 comment

0

May we see you're attempt? I know you'll need the :Destroy() method to remove it.

2 answers

✓ Accepted answer

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!

2 comments

0

Thanks! it worked!

0

No problem.

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

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