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: Weird Use for A regen Script?

Previous Thread :: Next Thread 
GWolflover is not online. GWolflover
Joined: 11 Jan 2010
Total Posts: 77
31 May 2012 04:32 PM
Why doesn't this script work? It is supposed to regen the brick that it is in and the other script in the brick. It is supposed to wait 10 secs after it is touched, then regen... but instead nothing happens.

model = script.Parent


backup = model:clone()

function onTouched(hit)
wait(10)

model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()

end
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
31 May 2012 04:33 PM
You never had a connection line.

Report Abuse
GWolflover is not online. GWolflover
Joined: 11 Jan 2010
Total Posts: 77
31 May 2012 04:37 PM
so how would I fix that?
Report Abuse
GWolflover is not online. GWolflover
Joined: 11 Jan 2010
Total Posts: 77
31 May 2012 04:39 PM
sorry I'm not the best at scripting.... I'm kinda new to it.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
31 May 2012 04:39 PM
Last line

script.Parent.Touched:connect(function_name_here)


And also, change the script.Parent to what you want to be touched.
Report Abuse
GWolflover is not online. GWolflover
Joined: 11 Jan 2010
Total Posts: 77
31 May 2012 04:45 PM
So would it be like this?

model = script.Parent


backup = model:clone()

function onTouched(hit)
wait(10)

model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()

script.Parent.Touched:connect(onTouched)


end



and why wouldn't script.Parent work if brick that I want to regen is the Parent of this script?
Report Abuse
FPShooter319 is not online. FPShooter319
Joined: 28 May 2012
Total Posts: 153
31 May 2012 04:47 PM
A connection line goes AFTER the function. Not inside.

model = script.Parent
backup = model:clone()
function onTouched(hit)
wait(10)
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
end
script.Parent.Touched:connect(onTouched)

MrMcAero
Report Abuse
GWolflover is not online. GWolflover
Joined: 11 Jan 2010
Total Posts: 77
31 May 2012 04:49 PM
so if I do that, would the script work even with model = script.Parent
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