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

How do i remove a part? (Solved!)

Im working on a roleplay where you can dig tunnels, and i recently learned some basic scripting. Now to why im asking this. If i dig the top 2 blocks, i cant dig anything else after colllision off and making the parts dug invisible, and that is the only way i know to show the block has been dug. So how do i either remove a part or send it under the map?

local clickdetector = game.Workspace.DiggableDirt["Row0(W/Grass)"].DirtBlockB.ClickDetector
local DigPart = game.Workspace.DiggableDirt["Row0(W/Grass)"].DirtBlockB
clickdetector.MouseClick:Connect(function()
   DigPart.Transparency = 0.5
   DigPart.CanCollide = false
end)

There is the code i used to collision off and invisible. I dont know how to do screenshots.

2 comments

0

Provide a script for us please, so we can further analyse this. Also show the parts in "Explorer" in an image so we can also check anything else. Thanks

0

Alright!

1 answer

✓ Accepted answer

:Destroy() removes an instance permanently.

If you only want it destroy temporarily, set it's parent to nil

2 comments

0

Ill try that, waifu.

0

owo

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