Truste135
|
  |
| Joined: 26 Oct 2010 |
| Total Posts: 741 |
|
|
| 29 Sep 2012 06:11 AM |
function onKeyDown(key) key:lower() if key == "f" then script.Parent.Parent.Parent.Character.Humanoid.Health = 0 end
[Now, whats the connection line again? ]
|
|
|
| Report Abuse |
|
|
Truste135
|
  |
| Joined: 26 Oct 2010 |
| Total Posts: 741 |
|
|
| 29 Sep 2012 06:14 AM |
Probably:
script.Parent.Selected:connect(onSelected)
lemme try. |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 06:14 AM |
Well, you need to target your mouse, you can do so whenever you equip the tool or hopperbin. Once you have the mouse targeted, you can connect your onKeyDown function into the code with:
mouse.KeyDown:connect(onKeyDown)
Here is a helpful link to the wiki if you want to get even more information on it. http://wiki.roblox.com/index.php/Equipped_(Event)
Here to help, `FlightTheory |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 29 Sep 2012 06:17 AM |
"Once you have the mouse targeted, you can connect your onKeyDown function into the code with:
mouse.KeyDown:connect(onKeyDown)"
That lacks a lot of information.
An connection line connects an event to the given function between the parameters. As in this script, the function is ´onKeyDown´. You could also make anonymous functions by directly making the function inside the parenthesis.
':connect(f)' is a method, the f is the function as described above. |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 06:20 AM |
Well indeed you could. Let's make things more complicated for them, shall we?
`FlightTheory |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 29 Sep 2012 06:22 AM |
You barely included information. You should include information, but not over complicate it and not supress the person by word-walls.
An example of what you did; Here is a box. It has many buttons and yes I know it's kinda hard to understand at first, but if you press a button it will explode. Have fun. *BOOM* |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 06:23 AM |
Well, I guess my way of wording it may have been a bit off, but it can't be that bad. If he couldn't understand what I posted, he has a direct link to a page that can help him out.
`FlightTheory |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 29 Sep 2012 06:25 AM |
Linking pages won't always help things and could even over-complicate things... But really, how else would he ever learn how anonymous functions work and how to use the connect method at its fullest? |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 06:27 AM |
Okay, seems you got me there. `FlightTheory |
|
|
| Report Abuse |
|
|