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
 

Regen Button Script

Previous Thread :: Next Thread 
xULRICHx is not online. xULRICHx
Joined: 11 Mar 2012
Total Posts: 94
09 Apr 2012 05:43 PM
Wont Regen Mai Car


local box = script.Parent

local debounce = false


local everything = {}
local names = {}

local children = game.Workspace:children()
for i=1,#children do
if (children[i].Name == "cart") then -- change My Model Name to ur model's name
table.insert(everything, children[i]:clone())
table.insert(names, children[i].Name)
end
end


function regen()
for i=1,#everything do
game.Workspace:findFirstChild(names[i]):remove()
new_thing = everything[i]:clone()
new_thing.Parent = game.Workspace
new_thing:makeJoints()
end
end

function onTouched(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
if humanoid~=nil and debounce == false then
debounce = true
wait(1)
box.Transparency = 1
box.CanCollide = false

regen()
wait(10) -- chage to the time you want befor it can regen again

box.CanCollide = true
box.Transparency = 0

debounce = false
end
end


script.Parent.Touched:connect(onTouched)
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