Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a part reappear?

Asked by 4 years ago

I want to make a part to reappear after I put remove() on it. How do you make it to where to it reappears after being destroyed?

0
you can't do that, because when you destroy the object it also destroys the script, what I'd do is just set the canCollide to false and make it invisible jediplocoon 877 — 4y
0
Well that sucks BadPiggie411 47 — 4y
0
also remove() is Deprecated, use :Destroy() Uzixt 19 — 4y

3 answers

Log in to vote
0
Answered by 4 years ago

You can't recover a part once you Destroy() or remove() it. But, you can falsely remove the part by changing it's Transparency property to 1 and changing it's CanCollide property to false (making it invisible and making it so you cant touch/collide with it), here is a script:

--make it disappear
script.Parent.Transparency = 1
script.Parent.CanCollide = false

--make it reappear again
script.Parent.Transparency = 0
script.Parent.CanCollide = true

You can put this into .Touched() functions and whatnot, enjoy!

0
I already know that but thanks, I'll accept your answer. BadPiggie411 47 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

You can't unremove bricks, but what I would do is:

local brick = part -- whatever the part is called

--disappear
part.Transparency = 1 -- make the part invisible
part.CanCollide = false -- make the player not be able to touch it/just go through it

--reappear
part.Transparency = 0 -- make the part visible
part.CanCollide = true -- make the player be able to touch it/not go through it

I hope this helps! If not then reply, your welcome!

Log in to vote
0
Answered by 4 years ago

Remember to accept this if this was what you were looking for:

local modelToRespawn = workspace.Part -- le part

local respawned = modelToRespawn:Clone()

modelToRespawn:Destroy()
wait(2)
respawned:Clone().Parent = workspace

What I see right now (since this is untested) is, modelToRespawn is the object, its being cloned, renamed as respawned in the start, once the main model is destroyed, the respawned is cloned and put in workspace to replace modelToRespawn!!

Anyways yeah, if you have questions, lmk.

Answer this question