I am removing each part of the tycoon that the player purchases to have it replaced in the game later. My problem is that I am doing this one by one. This is a tedious task and is taking way to long. Is there a better way?
This is currently what I am doing.
local tycoon = script.Parent.Parent local dirt = tycoon.Purchases.DirtDropper:Clone() dirt:Destroy() local stone = tycoon.Purchases.StoneDropper:Clone() stone:Destroy() local copper = tycoon.Purchases.CopperDropper:Clone() copper:Destroy()
I was thinking of doing local clone = tycoon.Purchases:GetChildren():Clone()
This would be a quick way to remove everything but when it came time to purchase an object all the parts would be re-added all at once. Right?
Thanks for the help ahead of time.
You're problem is that, the thing about :Clone() it needs to have a parent as well I create holo commands for groups, and to make the map simulation I have to clone it,
here is an example.
local map = game.ServerStorage.Map x = map:Clone() x.Parent = game.Workspace
that was an example, now let me help you out with your problem.
local tycoon = script.Parent.Parent local dirt = tycoon.Purchases.DirtDropper x=dirt:Clone() dirt:Destroy() -- extra code here for "x" local stone = tycoon.Purchases.StoneDropper s = stone:Clone() stone:Destroy() -- extra code here for "s" local copper = tycoon.Purchases.CopperDropper n = copper:Clone() copper:Destroy() --extra code here for "n"
I hope this fixes your problem, Have a nice day!