Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

Regen script problems..?

Asked by 11 years ago

I have gutted a script and I don't want a message to be displayed and so it regenerates without a message on your screen. I tried deleting and modifying a few text lines to no avail.

This is the script I'm using:

01---Place this INSIDE the model. Don't replace the model name or anything.
02------------------------------------------------------------------------------------------
03object = script.Parent
04if (object ~= nil) and (object ~= game.Workspace) then
05model = object
06messageText = "regenerating " .. model.Name .. ""
07 
08message = Instance.new("Message")
09message.Text = messageText
10backup = model:clone() -- Make the backup
11waitTime = 255 --Time to wait between regenerations
12wait(math.random(0, waitTime))
13while true do
14wait(waitTime) -- Regen wait time
15 
View all 27 lines...

Could anyone help me modify the script so I can take the timing out/displaying a message upon time of regeneration? Help would be greatly appreciated!

Also, please be very specific as I am a huge noob to Lua.

0
Why is everyone downvoting? It's just a question geez.. firedum 5 — 11y

1 answer

Log in to vote
0
Answered by
Vexyls 0
11 years ago

---Place this INSIDE the model. Don't replace the model name or anything.

02

03 object = script.Parent 04 if (object ~= nil) and (object ~= game.Workspace) then 05 model = object 06 messageText = "MESSAGE HERE" .. model.Name .. "MODEL NAME HERE" 07

08 message = Instance.new("Message") 09 message.Text = messageText 10 backup = model:clone() -- Make the backup 11 waitTime = 255 --Time to wait between regenerations 12 wait(math.random(0, waitTime)) 13 while true do 14 wait(waitTime) -- Regen wait time 15

16 message.Parent = game.Workspace 17 model:remove() 18

19 wait(1.5) -- Display regen message for this amount of time 20

21 model = backup:clone() 22 model.Parent = game.Workspace 23 model:makeJoints() 24 message.Parent = nil 25 end 26 end

27

Ad

Answer this question