dave2011
|
  |
| Joined: 02 Oct 2010 |
| Total Posts: 10581 |
|
|
| 15 Sep 2012 10:27 PM |
local mouse=game.Players.LocalPlayer:GetMouse() local Frame = script.Parent local function onKeyDown(m) --stuffs mouse.KeyDown:connect(onKeyDown)
it lets you press any key for the "stuff" to work and I want it so it only does "stuff" if you press the m key |
|
|
| Report Abuse |
|
|
mazer246
|
  |
| Joined: 13 Sep 2007 |
| Total Posts: 412 |
|
|
| 15 Sep 2012 10:32 PM |
I believe you are missing an arg in your connect line.
local mouse=game.Players.LocalPlayer:GetMouse() local Frame = script.Parent local function onKeyDown(m) --you are calling upon a parameter here (m) --stuffs mouse.KeyDown:connect(onKeyDown) --however here you do not request the parameter |
|
|
| Report Abuse |
|
|
mazer246
|
  |
| Joined: 13 Sep 2007 |
| Total Posts: 412 |
|
|
| 15 Sep 2012 10:35 PM |
I am very rusty at RBX.lua but try this:
local mouse=game.Players.LocalPlayer:GetMouse() local Frame = script.Parent local function onKeyDown(key) if key == "m" then --you need to check if the key is m, however, I am not sure how to do this --stuffs mouse.KeyDown:connect(onKeyDown(key))
|
|
|
| Report Abuse |
|
|
mazer246
|
  |
| Joined: 13 Sep 2007 |
| Total Posts: 412 |
|
|
| 15 Sep 2012 10:37 PM |
blah, triple post D:
You can check what to put into the 4th line by printing key |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 15 Sep 2012 10:40 PM |
local mouse = game.Players.LocalPlayer:GetMouse() local Frame = script.Parent
mouse.KeyDown:connect(function(key) if key == "m" then --stuff end end) |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2012 10:42 PM |
adark is right^
Plus put in local script.
if CookieMonster.pro == true then do repeat wait() KirbyDance until CookieMonster.pro = false --In other words, KirbyDance forever!
-Tester- |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2012 11:11 PM |
OT QUESTION:
Would this work not in a tool? |
|
|
| Report Abuse |
|
|
dave2011
|
  |
| Joined: 02 Oct 2010 |
| Total Posts: 10581 |
|
|
| 15 Sep 2012 11:54 PM |
| @thedeath, I have tons of mouse things that would require a lot of different tools for my game so it would be much easier without tools |
|
|
| Report Abuse |
|
|
|
| 16 Sep 2012 12:19 AM |
@Death Yea because of the new method >:o |
|
|
| Report Abuse |
|
|