|
| 03 Nov 2012 04:28 PM |
| What are the starting lines if I press the key r and hold it down and then if I release and what will be the connection? I will do the effect of it myself. |
|
|
| Report Abuse |
|
|
Monkey727
|
  |
| Joined: 12 Jan 2009 |
| Total Posts: 969 |
|
|
| 03 Nov 2012 04:35 PM |
If your pressing keys down, The only thing I could think of is doing it with a Hopperbin:
function onKeyDown(key) if key == "r" then -- Pressed r end end
function onKeyUp(key) if key == "r" then -- Released r end end
function onSelected(mouse) mouse.KeyDown:connect(onKeyDown) mouse.KeyUp:connect(onKeyUp) end
script.Parent.Selected:connect(onSelected)
As for the "holding down r" you would need to put a wait between the KeyUp and KeyDown functions or something. Kinda confusing for me to explain so try and figure the rest out by your self. :3 |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 03 Nov 2012 04:38 PM |
I belive GetMouse would work too, so:
function onKeyDown(key) if key == "r" then print("User pressed '"..key.."'!") end end function onKeyUp(key) if key == "r" then print("User depressed '"..key.."'!") end end mouse = game.Players.Player:GetMouse() mouse.KeyDown:connect(onKeyDown) mouse.KeyUp:connect(onKeyUp) |
|
|
| Report Abuse |
|
|