I made a LocalScript which is suppose to destroy/remove its Parent which is a Model. This is the script I made:
function DestroyName() --name of function script.Parent:destroy() --this is suppose to destroy it end --end while true do --order to Begin DestroyName() --what to do end --end
This didn't work! It didn't destroy/remove its Parent. Can someone help with this?
Try this there is no guarantee though... If it did work a upvote is appreciated, thanks.
function DestroyName() --name of function script.Parent:Destroy() --this is suppose to destroy it end --end while wait(0.1) do--order to Begin DestroyName() --what to do end --end
Well, destroy should be capital (So, Destroy()
)
Second, while loops without a wait()
will crash the game.
Third, what is the point of a while loop? Once it's destroyed, you should not need to destroy it again.
Fourth, a local script should not be necessary.