generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Looking for a regen script [Read for the details]

Previous Thread :: Next Thread 
GMANSTA is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. IAmAMelon
Joined: 14 Mar 2013
Total Posts: 167
29 Jun 2013 10:35 AM
Yes.
Report Abuse
pudinrox is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image