How to make another script stop running after it has been destroyed?
The script below destroys the other script which is just a tween move script but after it destroys the script, the script that has been destroyed still runs. That means its gone from the workspace but it still has the effects. Why is that and how can i fix it? Also i am new to scripting so please don't criticize me, thnx
1 | local CurrentPos = workspace.touchablepart.Position |
3 | if workspace.touchablepart.ClickDetector.MouseClick then |
4 | workspace.MoveScript:Destroy() |
5 | elseif workspace.touchablepart.ClickDetector.MouseHoverEnter then |
7 | workspace.touchablepart.Position = CurrentPos + Vector 3. new( 2 , 0 , 0 ) |