Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Can anyone help with destroy and respawn??

Im trying to make it where the clone of an object ONLY spawns after one has been destroyed. Sort of like

if Part is destroyed then Part.Clone() spawns

but i can't figure out how to word it for the script. Can anyone please help me?

2 comments

0

local PartToClone = game.lighting.PartToClone

0

Never use Lighting for storage. You should use ReplicatedStorage or ServerStorage

2 answers

Say the part was named "Part". You could dupe it into rep. storage, and then do something like this:

while true do
	if game.Workspace:FindFirstChild("Part") == nil then
		wait(1.5)
		game.ReplicatedStorage.Part:Clone()
		game.Workspace.Part.Position = --Your Position Here
	end
end

1 comment

0

i tried this, it just keeps making the part disappear seconds after i run the game. I've checked my script to make sure I got everything right.

Something like that? Might work idk

local PartToClone = game.lighting.PartToClone:Clone() if game.workspace.PartToClone then else PartToClone.Parent = workspace end

This discussion is preserved as it was. New answers, comments, and votes are closed.