How would I script a tool which would destroy a part with a certain material e.g. part.Material == "Sand"?
I made a tool which my player can hold as a starting point by adding a handle. How would I make it so that if a player touches an object with the sand material the tool in its hand the part will destroy?
how would I use the destroy() function?
Also, previously I made this code which would make the transparency of an object 1 and cancollide false so you can remove the object where you cant see it and wont collide into it but I don't know where to place it as a local script in my tool with the local script in the tool and not in the handle but when I tried nothing happened when i clicked on the part I wanted to make transparent which was called Terrain and nothing happened and I had the tool equipped.
Code I used previously:
script.Parent.Activated:Connect(function(mouse)
if mouse.Hit.Name == "Terrain" then step = .1
waitC = .1
for i=0,1 step do
mouse.Hit.Transparency = i
wait(waitC)
end
mouse.Hit.CanCollide = false
end
end)
Thank You and help is appreciated
