So far I managed to make the object become removed once touched, but I can't manage to have the parent of the script reappear successfully. I would like the parent to reappear after 90 seconds of being removed from the workspace. Any help?
script.Parent.Touched:connect(function() script.Parent:Destroy(); end)
You can't actually make the part come back into the workspace unless you are talking about a completely new part. When you use the Destroy() you are completely removing it from your game until the server restarts. If you are talking about a completely new part, you would need to put the script somewhere else because all of the children of the part would also be destroyed. I myself would just change the parent of the part and change it back after 90 seconds. That would look something like this:
debounce = false script.Parent.Touched:Connect(function() if not debounce then debounce = true script.Parent = game.ServerStorage wait(90) script.Parent = workspace debounce = false end end)
Also, you should no longer be using :connect (talking about the lowercase "c"). That has been deprecated meaning it will no longer work in a later update, as a result, you should use ":Connect", with an uppercase "c". Hope I helped you out.
-cmgtotalyawesome
EDIT: If you were unsure of what the debounce did, it is just a way to keep the function from running over and over again, making it take longer than 90 seconds to put the part back, and also to avoid errors from the function.