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

Respawning a part ?

Hello! I wanna know how to make a part respawning after being destroyed. That will help. Thanks!

8 comments

0

Can you post your code.

0

script.Parent.Touched:connect(function() script.Parent.CRAC:Play() wait(0.496) script.Parent:Destroy() wait(2) end) So I need to implant a respawning line.

0

Why not just make the par cancollide false and transparency 1 then reset it? also you can edit your question to include the code, https://forum.scriptinghelpers.org/topic/82/how-to-format-questions-answers-on-the-main-site

0

I tried but it won't work.

0

You also may want to add a debouncehttp://wiki.roblox.com/?title=Debounce

0

Try putting it in lighting and then cloning it to Workspace.

0

Wait

0

I just don't understand.

1 answer

Flopope, you should not actually Destroy() your part as that clears its memory. Simply set its parent to nil, then re-parent after two seconds. From your code in the comments:

script.Parent.Touched:connect(function()
	script.Parent.CRAC:Play()
	wait(0.496)
	local parent = script.Parent.Parent
	script.Parent.Parent = nil
	wait(2)
	script.Parent.Parent = parent
end)

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