print("LandMine Script Loaded") LandMine = script.Parent function onTouched(hit) explosion = Instance.new("Explosion") explosion.BlastRadius = 20 explosion.BlastPressure = 100000 explosion.Position = script.Parent.Position explosion.Parent = game.Workspace script.Parent.Transparency = 0 wait(2) game.Workspace.Meteor.Meteor1:Destroy() end connection = LandMine.Touched:connect(onTouched)
This is the code i used to make the Meteor fall, hit the ground, and in 2 seconds go away. My only problem is that it gets destroyed, aka deleted from the game. Im trying to make it so that it goes away, and in 10 seconds respawns where it started from.
You need to save its original position, and set its position back to that after setting the meteor's parent to nil (or wherever you want to put it while it waits to respawn).
print("LandMine Script Loaded") local LandMine = script.Parent local pos = game.Workspace.Meteor.Meteor1.Position local meteor = game.Workspace.Meteor.Meteor1 function onTouched(hit) explosion = Instance.new("Explosion") explosion.BlastRadius = 20 explosion.BlastPressure = 100000 explosion.Position = script.Parent.Position explosion.Parent = game.Workspace script.Parent.Transparency = 0 wait(2) meteor.Parent = nil wait(10) meteor.Parent = workspace meteor.CFrame = CFrame.new(pos) --// Edit this to fit your needs, e.g. if it's a model use :SetPrimaryPartCFrame() instead. end connection = LandMine.Touched:connect(onTouched)
Alternatively, you could set up a script that just destroys it and clones in a new one; it's up to you. Hope this helped.