I’m just wondering if theres any way to restore a model via a script function after removing it.
Here’s a quick example of what I’m trying to go for,
button.MouseButton1Click:Connect(function()
model:Remove() -- Player left clicks a button, removing the model.
end)
button.MouseButton2Click:Connect(function()
model:Restore() -- Player right clicks a button, causing the model to come back.
end)
Keep in mind that I’m not trying to make the model disappear or turn invisible, which would look like this:
model.Transparency = 1; model.Transparency = 2
I’m trying to make the model entirely be restored, like refreshed. As far as I’m concerned, theres no function by the name of Restore() or Refresh(), or anything similar.
Let me know if you want me to send my full program in the replies, these are just quick examples^.
Edit: I forgot to mention that I’m not trying to go for a Clone() type function and getting another model off of the ServerStorage.
@InfiniteBlackPIX’s script is very similar to the script on this link: Instance | Roblox Creator Documentation
Lighting isn’t needed (and has been replaced by ServerStorage or ReplicatedStorage).
It just parents the object to the workspace when you want it and to nil when you don’t.
If you have a group of objects you want to remove and then parent to workspace then you’d either have to put them in a table, name them all with different names, or put a script in each item with a clickdetector.