Part Delete on touch

Hello Developers,

I’m currently making a conveyer and making a “machine” drop coins and i want to make like sell system like in a tycoon on touch it deletes a part but i do not want to give the player any money, just when the part touches the “sell part” the coin get deleted.

How could i do this? Thanks in advance for the help!!

3 Likes

use .Touched event

part.Touched:Connect(function()
    part:Destroy()
end)

You’ll need to check what has touched the conveyer, and check if that’s a part from droppers, and then sell it. [Use .Touched event]

It doesn’t delete the coin for some reason, i have tried this

script.Parent.Touched:Connect(function(hit)
        if hit.Name == "YourPartsNameHere" then
               hit:Destroy()
               --run any other code here
        end
end)

also put this as a server script (normal script) inside of the part

Thank you so much! This works perfectly

1 Like