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: How do you use the...

Previous Thread :: Next Thread 
iPoxon is not online. iPoxon
Joined: 27 Jun 2011
Total Posts: 283
04 Oct 2012 06:24 PM
How do you use the onClick command? Is it onclick on click on Click, on Click, or onClick, and can you give me an example of how its used?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
04 Oct 2012 06:29 PM
Any of those. Though, you'd have to specify what event you're talking about.

¤ ¤ † K M X D † ¤ ¤
Report Abuse
iPoxon is not online. iPoxon
Joined: 27 Jun 2011
Total Posts: 283
04 Oct 2012 06:29 PM
Okay?
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
04 Oct 2012 06:32 PM
function OnClicked() --you can name the function whatever you want as long as you connect is it with the event you want
print("Clicked")
script.Parent.MouseButton1Down:connect(OnClicked) -- you're connected the function OnClicked to the event MouseButton1Down
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
04 Oct 2012 06:33 PM
What do you mean by clicking? A GUI, or 3-D object with ClickDetectors?

¤ ¤ † K M X D † ¤ ¤
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
04 Oct 2012 06:33 PM
@death

You forgot an end.

¤ ¤ † K M X D † ¤ ¤
Report Abuse
iPoxon is not online. iPoxon
Joined: 27 Jun 2011
Total Posts: 283
04 Oct 2012 06:34 PM
A physical part.
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
04 Oct 2012 06:34 PM
@Knight

Just an example. Examples don't have to be right... atleast in my world
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
04 Oct 2012 06:35 PM
ClickDetector:

function OnClick(plr)
print(plr)
end
script.Parent.ClickDetector.MouseClick:connect(OnClick)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
04 Oct 2012 06:36 PM
You'd have to insert a ClickDetector to a part, and use the .MouseClick event for it.

Example:

    Workspace.Part.ClickDetector.MouseClick:connect(function()
    print"PlayerClick"
    end)

@death

It is when it doesn't work, and uses the wrong event. :P

¤ ¤ † K M X D † ¤ ¤
Report Abuse
iPoxon is not online. iPoxon
Joined: 27 Jun 2011
Total Posts: 283
04 Oct 2012 07:03 PM
Thanks. I have 1 more question, How do I bring a tool from Lightning to a starterpack?
Report Abuse
iPoxon is not online. iPoxon
Joined: 27 Jun 2011
Total Posts: 283
04 Oct 2012 07:04 PM
Lighting*
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