So im very new to scripting and im trying to make a block that becomes slowly more transparent when you step on it, and then deletes itself. now the script works fine but the problem is if i keep walking on the block it will play the script again and the transparency will crazy for a second and then it deletes the block. heres the script.
function touch(hit)
wait (0.3)
game.Workspace.disapear.Transparency = 0.5
wait (0.3)
game.Workspace.disapear.Transparency = 0.75
wait (0.3)
script.Parent:remove()
end
script.Parent.Touched:connect(touch)

2 comments
Use a debounce.
this code is also bad, cause it uses remove and connect which are deprecated, and its not indented either