2DWorlds Forums
Regen script pl0x - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: 2DWorlds Discussion (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=10)
+--- Thread: Regen script pl0x (/showthread.php?tid=4914)



Regen script pl0x - McNoobster - 05-24-2011

Can someone make one. With instructions. :]

Also like the script from roblox in there wiki pl0x

[lua]brick = game.Workspace.Brick --tagging the brick

function onTouch(part) --the function

brick.Transparency = 1 --what the function is to do with the brick
wait(1)
brick.Transparency = 0
end

brick.Touched:connect(onTouch) --listening event
[/lua]


RE: Regen script pl0x - Qwertygiy - 05-24-2011

Easy enough.

[lua]
local thing = script.Parent
local nuthing = thing:clone()
local par = thing.Parent

while true do --Somewhat redundant :/
sleep(120) --Two minutes between regens. Change it to however long you want.
game:message("Regenerating " .. thing.Name) --Change message if you want.
sleep(1)
thing.Parent = game.Storage
nuthing.Parent = par
sleep(1)
game:message()
thing:remove()
script:remove() --Just in case.
end
[/lua]

I haven't tested it -- but it should work. Just copy it into a script and place the script inside the model you want to regen.


RE: Regen script pl0x - McNoobster - 05-24-2011

(05-24-2011, 07:56 PM)Qwertygiy Wrote: Easy enough.

[lua]
local thing = script.Parent
local nuthing = thing:clone()
local par = thing.Parent

while true do --Somewhat redundant :/
sleep(120) --Two minutes between regens. Change it to however long you want.
game:message("Regenerating " .. thing.Name) --Change message if you want.
sleep(1)
thing.Parent = game.Storage
nuthing.Parent = par
sleep(1)
game:message()
thing:remove()
script:remove() --Just in case.
end
[/lua]

I haven't tested it -- but it should work. Just copy it into a script and place the script inside the model you want to regen.

Thanks can you change the other one I just posted to


RE: Regen script pl0x - Jacob__mybb_import1 - 05-24-2011

I wrote a tutorial for this: http://buildism.net/forum/Thread-How-to-Rebuild-Something-with-Scripting

Unlike Qwertygiy's, it takes an existing model in the game, backs it up, and restores the backup when needed, rather than copying the model from storage.