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 |
|
|
|
| 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
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 283 |
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 04 Oct 2012 06:33 PM |
@death
You forgot an end.
¤ ¤ † K M X D † ¤ ¤ |
|
|
| Report Abuse |
|
|
iPoxon
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 283 |
|
| |
|
|
| 04 Oct 2012 06:34 PM |
@Knight
Just an example. Examples don't have to be right... atleast in my world |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2012 06:35 PM |
ClickDetector:
function OnClick(plr) print(plr) end script.Parent.ClickDetector.MouseClick:connect(OnClick) |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 283 |
|
| |
|