GMANSTA
|
  |
| Joined: 26 Mar 2011 |
| Total Posts: 539 |
|
|
| 29 Jun 2013 08:26 AM |
I'm looking for a regen script, it regens an object (like a tool) every X minutes on it's own. If anyone knows please answer, and if you're kind enough to post one please do so.
Don't start saying I'm lazy, that I am an idiot who can't script. I don't have the time to script, and I spend a lot of my free time trying.
I'm going to admit that I can't script. I'm already in college and it's not a blast having lil' free time. I hope you understand, |
|
|
| Report Abuse |
|
|
IAmAMelon
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 167 |
|
|
| 29 Jun 2013 08:31 AM |
regenTime = 60 spawner = workspace.Part clone = nil
while wait(regenTime) do tool = workspace.Tool or clone and clone:Clone() if clone and clone.Parent == workspace then clone:Destroy() end clone = tool:Clone() clone.Parent = workspace clone.Handle.CFrame = spawner.CFrame + Vector3.new(0, 1, 0) end
-- Should do what you want it to do. |
|
|
| Report Abuse |
|
|
GMANSTA
|
  |
| Joined: 26 Mar 2011 |
| Total Posts: 539 |
|
|
| 29 Jun 2013 08:34 AM |
| Thank you Sir, does this also happen to work with objects that aren't tools are is it just tools? |
|
|
| Report Abuse |
|
|
IAmAMelon
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 167 |
|
|
| 29 Jun 2013 08:41 AM |
This is just a simple idea for it. Instead, for models you could do something like:
regenTime = 60 backup = workspace.Model:Clone() clone = workspace.Model
while wait(regenTime) do if clone and clone.Parent == workspace then clone:Destroy() end clone = backup:Clone() clone.Parent = workspace clone:MakeJoints() end
|
|
|
| Report Abuse |
|
|
pudinrox
|
  |
| Joined: 30 May 2010 |
| Total Posts: 2358 |
|
|
| 29 Jun 2013 10:12 AM |
| I am a Melon, what happens if you have multiple models? and not named Model. And you don't want to regen everything. I think that's what he is looking for. |
|
|
| Report Abuse |
|
|
IAmAMelon
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 167 |
|
|
| 29 Jun 2013 10:14 AM |
| If it's not named Model, just change the part where it says "workspace.Model" to where it's located. If you have multiple Models, you could do a table. |
|
|
| Report Abuse |
|
|
GMANSTA
|
  |
| Joined: 26 Mar 2011 |
| Total Posts: 539 |
|
|
| 29 Jun 2013 10:29 AM |
| I never thought about that, so if the item I want to rgen is called, lets say Peanut, I change workspace.Model to workspace.Peanut ? |
|
|
| Report Abuse |
|
|
IAmAMelon
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 167 |
|
| |
|
pudinrox
|
  |
| Joined: 30 May 2010 |
| Total Posts: 2358 |
|
|
| 29 Jun 2013 10:41 AM |
If you had multiple would it be:
regenTime = 90 backup = workspace.Model:Clone() backup = workspace.Model2:Clone() clone = workspace.Model clone = workspace.Model2
while wait(regenTime) do if clone and clone.Parent == workspace then clone:Destroy() end clone = backup:Clone() clone.Parent = workspace clone:MakeJoints() end
But it doesn't seem right... |
|
|
| Report Abuse |
|
|
IAmAMelon
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 167 |
|
|
| 29 Jun 2013 10:48 AM |
clones = { workspace.Model; workspace.Model2; }
backups = {} for k,v in pairs(targets) do backups[k] = v:Clone() end
while wait(regenTime) do for i, clone in pairs(clones) do if clone and clone.Parent == workspace then clone:Destroy() end clones[i] = backups[i]:Clone() clones[i].Parent = workspace clones[i]:MakeJoints() end
--Something like this for multiple things. |
|
|
| Report Abuse |
|
|