|
| 01 Jun 2013 06:27 PM |
--Im not going to lie, i borrowed this from someone else :P --Won't regen with no outputs, I wanted to remove the message because I think they look ugly and take away from your game's realism so i did and it wont work --What happened to it? D:
object = script.Parent if (object ~= nil) and (object ~= game.Workspace) then model = object
if game.Workspace.Alarm.Light1.PointLight.Enabled == true then backup = model:clone() waitTime = 1 wait(math.random(0, waitTime)) while true do wait(waitTime) end
message.Parent = game.Workspace model:remove()
wait(2.5)
model = backup:clone() model.Parent = game.Workspace model:makeJoints() message.Parent = nil end end
print("Regenerated!") |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 06:29 PM |
message.Parent = game.Workspace
No message makes it not work
I think |
|
|
| Report Abuse |
|
|
zakary99
|
  |
| Joined: 19 Jan 2010 |
| Total Posts: 1095 |
|
|
| 01 Jun 2013 06:37 PM |
message = Instance.new("Message") object = script.Parent if (object ~= nil) and (object ~= game.Workspace) then model = object
if game.Workspace.Alarm.Light1.PointLight.Enabled == true then backup = model:clone() waitTime = 1 wait(math.random(0, waitTime)) while true do wait(waitTime) end
message.Parent = game.Workspace model:remove()
wait(2.5)
model = backup:clone() model.Parent = game.Workspace model:makeJoints() message.Parent = nil end end
print("Regenerated!")
Ooooo, bio electric dampening field with a retrogressive arc inversion. Follow me on Twitter @RBX_Zakary99 |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 Jun 2013 06:52 PM |
After this line:
'model:remove() '
The script won't run. You realize that?
Because if the script is inside the model, and the model gets destroyed, so does the script.
Also, the line where it says:
'message.Parent = game.Workspace'
Should be removed, as the message no longer exists.
|
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 06:52 PM |
| So just get rid of those two lines? |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 06:54 PM |
Getting rid of the model:Remove() line will not delete the old model in that case.
Your best bet is putting it at the end.
However, just to make sure it works, you might want to remove those two lines as just a test. |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 06:56 PM |
| Yea didnt work so i'll put it at the bottom. Also, should I delete the line that says something like message.Parent = nil |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 06:57 PM |
| Yep, anything with 'message' in it, you should get rid of, because the message no longer exists. |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 06:58 PM |
Okay. Got rid of the model and didnt come back
|
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 06:59 PM |
| Did it print 'Regenerated'? |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 07:03 PM |
| No, and it removed the model when i spawned |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 07:04 PM |
| I mean it didnt wait for the pointlight to be enabled |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 07:04 PM |
| Oh I see the problem now. Give me a second to find a way to fix it. |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 07:05 PM |
Hmm, can you post the current script so I can go off that?
Thanks. |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 Jun 2013 07:06 PM |
object = script.Parent if (object ~= nil) and (object ~= game.Workspace) then model = object
if game.Workspace.Alarm.Light1.PointLight.Enabled == true then backup = model:clone() waitTime = 1 wait(math.random(0, waitTime)) --is from here to 'end' necessary? while true do wait(waitTime) end
wait(2.5)
model = backup:clone() model.Parent = game.Workspace model:makeJoints() end end
print("Regenerated!")
model:remove() |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 07:08 PM |
Ok, so I'm going to rewrite the script.
Is it when the PointLight is enabled, you want the regen to happen?
Just double-checking if that is what you want. |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 Jun 2013 07:14 PM |
object = script.Parent if (object ~= nil) and (object ~= game.Workspace) then
model = object
repeat wait(.1) until game.Workspace.Alarm.Light1.PointLight.Enabled == true backup = model:clone() waitTime = 1 wait(waitTime)
model = backup:clone() model.Parent = game.Workspace model:MakeJoints() end end
print("Regenerated!")
object:Destroy()
That should work. |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 07:18 PM |
| Its not, i cant post the output because roblox is having a weird error :/ |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 07:19 PM |
Workspace. Alarm. Regen: 15: 'eof' expected near 'end' there we go |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 07:20 PM |
There is an extra 'end'.
Take out one of them. |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 07:23 PM |
| Okay uhm is there a way to keep the original copy to paste over and over again? Im hooking it up to a button and breaking glass and every second the glass regens half falling over, falls over, then regens fallen over and so on |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2013 07:24 PM |
| I guess in theory making the glass break after it copies is a good way of doing that |
|
|
| Report Abuse |
|
|