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: Why doesnt this work?

Previous Thread :: Next Thread 
doneyes is not online. doneyes
Joined: 21 Mar 2008
Total Posts: 3466
11 Feb 2012 04:50 PM
function clicked()

wait(1)

script.Parent.Parent.Hold2:Remove()
script.Parent.Parent.Thruster.Smoke.Enabled = true

wait(3)

script.Parent.Parent.Thruster.BodyThrust.force = Vector3.new(0,1000000,0)


script.Parent.ClickDetector.MouseClick:connect(clicked)
Report Abuse
noobkid is not online. noobkid
Joined: 17 Sep 2007
Total Posts: 649
11 Feb 2012 04:53 PM
You need an end
Report Abuse
zTopz is not online. zTopz
Joined: 08 Feb 2012
Total Posts: 17
11 Feb 2012 04:57 PM
Most people put ends at the end of their scirpts XD
Report Abuse
Phellem is not online. Phellem
Joined: 04 Aug 2011
Total Posts: 1984
11 Feb 2012 05:03 PM
function clicked()

wait(1)
script.Parent.Parent.Hold2:Remove()
script.Parent.Parent.Thruster.Smoke.Enabled = true
wait(3)
script.Parent.Parent.Thruster.BodyThrust.force = Vector3.new(0,1000000,0)
end

script.Parent.ClickDetector.MouseClick:connect(clicked)

or


script.Parent.ClickDetector.MouseClick:connect(function()
wait(1)
script.Parent.Parent.Hold2:Remove()
script.Parent.Parent.Thruster.Smoke.Enabled = true
wait(3)
script.Parent.Parent.Thruster.BodyThrust.force = Vector3.new(0,1000000,0)
end)
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
11 Feb 2012 05:22 PM
@Phellem

There's no difference except the second script is an anonymous function.
Report Abuse
Phellem is not online. Phellem
Joined: 04 Aug 2011
Total Posts: 1984
11 Feb 2012 05:28 PM
@miz656

I know.
I just like to show an anonymous function.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
11 Feb 2012 05:29 PM
Same here. Though, I wouldn't use it because he might not know how to use it.
Report Abuse
doneyes is not online. doneyes
Joined: 21 Mar 2008
Total Posts: 3466
11 Feb 2012 05:36 PM
Which one is anonymous?
Report Abuse
noobkid is not online. noobkid
Joined: 17 Sep 2007
Total Posts: 649
11 Feb 2012 05:38 PM
The one without a variable holding the function...
Report Abuse
doneyes is not online. doneyes
Joined: 21 Mar 2008
Total Posts: 3466
11 Feb 2012 05:42 PM
I used your script, then it worked. Then I added a little bit of something to it, and it stopped working. wtf?

function clicked()

script.Parent.Parent.Door.Transparency = 0
script.Parent.Parent.Door.CanCollide = true
wait(1)
script.Parent.Parent.Hold2:Remove()
script.Parent.Parent.Thruster.Smoke.Enabled = true
wait(3)
script.Parent.Parent.Thruster.BodyThrust.force = Vector3.new(0,120000,0)
end

script.Parent.ClickDetector.MouseClick:connect(clicked)
Report Abuse
socccerstar is not online. socccerstar
Joined: 23 Aug 2008
Total Posts: 489
11 Feb 2012 05:44 PM
Output?
Report Abuse
Phellem is not online. Phellem
Joined: 04 Aug 2011
Total Posts: 1984
11 Feb 2012 05:45 PM
script.Parent.Parent.Hold2:Remove()

May caused the error.
Since you removed it the first time, the second time, the object isn't there. Making it stop working the second time.

Hoped that made sense.
Report Abuse
doneyes is not online. doneyes
Joined: 21 Mar 2008
Total Posts: 3466
11 Feb 2012 05:58 PM
What, do you think I'm in build mode? I'm in studio. You hit the rewind button and play it over basically.
Report Abuse
Phellem is not online. Phellem
Joined: 04 Aug 2011
Total Posts: 1984
11 Feb 2012 06:01 PM
Okay.
So you only added:
script.Parent.Parent.Door.Transparency = 0
script.Parent.Parent.Door.CanCollide = true


Check if 'Door' is in script.Parent.Parent.
Make sure it's spelled correctly.

If you still have problems, check your output.
Report Abuse
doneyes is not online. doneyes
Joined: 21 Mar 2008
Total Posts: 3466
11 Feb 2012 06:21 PM
Output wont read.
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