2DWorlds Forums

Full Version: Regen script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I don't know if there are already some around, but here you go.

Put everything you want to regen in a model called Regenables and put the model in game.World.

[lua]function waitFor(time)
local waittime = os.time()
while os.time() - waittime < time do
sleep(0.001)
end end

I = game.World.Regenables:clone()
I.Parent = game.Storage

while true do
waitFor(25)
game.World.Regenables:remove()
local F = I:clone()
F.Parent = game.World
end[/lua]