Temprist
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 10060 |
|
|
| 03 Jun 2017 08:34 PM |
This regen script is inside of a model that is supposed to regenerate when the value Regen is equal to 4. But, whenever it regens, it creates two copies of the model, and the next time it regens, 3 copies, and so on.
object = script.Parent if (object ~= nil) and (object ~= game.Workspace) then model = object backup = model:clone() while true do wait(1) if game.Workspace.Regen.Value == 4 then model:remove() wait(0.5) model = backup:clone() model.Parent = game.Workspace model:makeJoints() end end end
How would I fix this?
|
|
|
| Report Abuse |
|
|
Temprist
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 10060 |
|
| |
|
|
| 03 Jun 2017 09:21 PM |
| Are you regening the script too perhaps? |
|
|
| Report Abuse |
|
|
Temprist
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 10060 |
|
|
| 03 Jun 2017 09:27 PM |
Ah... Yeah, that's a good point.
I added it to the workspace and edited it a bit, but now it's not working at all.
object = game.Workspace.Build if (object ~= nil) then model = object backup = model:clone() while true do wait(1) if game.Workspace.Regen.Value == 4 then model:remove() wait(0.5) model = backup:clone() model.Parent = game.Workspace model:makeJoints() game.Workspace.Regen.Value = 0 end end end
|
|
|
| Report Abuse |
|
|
Temprist
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 10060 |
|
|
| 03 Jun 2017 10:01 PM |
Nvm, I temporary disabled the script and forgot to enable it again. I'm dumb, lmao
Thanks for the help @IlluminatiCat
|
|
|
| Report Abuse |
|
|