all this is is a local script with the following code in;
1 | script.Parent.Touched:Connect( function (hit) |
2 | if game.Players:GetPlayerFromCharacter(hit.Parent) then |
3 | script.Parent:Destroy() |
4 | end |
5 | end ) |
Hey!
The reason as to why your script isn't working is because you are using a LocalScript
in Workspace
. A localscript cannot function in workspace to destroy a part. Put it in StarterCharacterScripts Instead.
You will need to change the code, and this is how you would do it:
1 | local NowEnteringPart = workspace.NowEntering -- NOTE! If you change where the part is located, make sure to change this as well! |
2 |
3 | NowEnteringPart.Touched:Connect( function (hit) |
4 | NowEnteringPart:Destroy() |
5 | end ) |