How to check if a script is deleted?
local targetscript = game -- Insert here your script address. repeat wait() until targetscript == nil -- Your code here.
First set the variable "targetscript" to your script. Once you have done that, the script will make a bucle doing nothing until the variable is nil (Which means it no longer exists).
Later, replace the "Your code here" with the code you want to execute. Hope it was useful! :3