i don't know programming too much so i tried this
1 | script.Parent.Touched:connect( function (hit) |
2 | if hit and hit.Parent:FindFirstChild( 'Humanoid' ) then |
3 | script.Parent:Destroy(game.Workspace.Trigger) |
4 | end |
5 | end ) |
but it didnt work can someone help ???
You have to create a variable for the part you want to destroy. So like this:
1 | local Trigger = game.Workspace.Trigger |
2 | script.Parent.Touched:connect( function (hit) |
3 | if hit and hit.Parent:FindFirstChild( 'Humanoid' ) then |
4 | Trigger:Destroy() |
5 | end |
6 | end ) |
This should work and if it doesn't just let me know