Pages

Saturday, September 24, 2011

Maggiemuston, How to make a regen script!

Hi there its maggiemuston with her 2nd scripting post this time its a regen script. Follow the steps below: carefully.

1. Open build and get into Roblox Studio.

2. Go into insert and press 'Object'.

3. Press script and "Ok".

4. Double click the script in Explorer.

5. It should say "print 'hello world'"

6. Now here's the script I will explain:

local regenTime = 180 -- 3 minutes - 180 seconds not minutes or hours this shows how long until the next regen. local messageTime = 2.5 - How long you want the message to show when it says regeing a model.  local model = script.Parent  local message = Instance.new("Message")  --Check that the script hasn't been placed in workspace if model ~= workspace then   message.Text = "Regenerating " .. model.Name - This is the message...   local backup = model:clone() -- Make the backup - in case if anything goes wrong it will back it up.    while true do    wait(regenTime)     --Remove the model   model:remove()    --Show the message   message.Parent = game.Workspace    wait(messageTime)   message.Parent = nil    --Copy the backup   model = backup:clone()    model.Parent = game.Workspace    model:makeJoints()  end else  error("Script not put in a model! Nothing to regenerate!") end 
7. Now carefully drag this script to the model you want to regen.
8. Save and come back in the game to test it out, IT WORKS!
Thanks for reading my scripting tutorial next time you will see how to make a conveyor belt!

No comments:

Post a Comment

Write your comment here... OR Flingi will eat you