AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 10 Apr 2015 06:57 PM |
| If you try to use like a sprint key in game and scroll out using your mouse wheel at the same time it won't let you. Anyone know why? |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 10 Apr 2015 07:01 PM |
| You probably aren't using UserInputService. |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 10 Apr 2015 07:03 PM |
1. I'm using the regular KeyDown
2. They obviously changed something in the past day. Worked before. |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 10 Apr 2015 07:05 PM |
regular old KeyDown is depreciated
--
the only reason it still works at all is so that old games and tools don't break
you shouldn't use it in new scripts.
UserInputService is the way to go. |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 10 Apr 2015 07:08 PM |
| That's not the point... they wouldn't purposely break it... |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2015 07:12 PM |
KeyDown should go down! UserInputService FTW
But seriously, you just don't use it anymore, that's the problem. They've obviously limited the support to encourage the use of UIS |
|
|
| Report Abuse |
|
|
oplmn1
|
  |
| Joined: 25 Nov 2010 |
| Total Posts: 994 |
|
|
| 10 Apr 2015 07:14 PM |
| The problem with mouse stuff is only one event fires each script refresh so if you are scrolling the same time you press a key it aint gon fire both of em |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 10 Apr 2015 07:19 PM |
UserInputService is the answer.
You are not suppose to use KeyDown because UserInputService can do EVERYTHING that KeyDown can do, plus infinitely more.
It was invented as an upgrade, a completely new service that is better and can extend to multiple platforms. |
|
|
| Report Abuse |
|
|
oplmn1
|
  |
| Joined: 25 Nov 2010 |
| Total Posts: 994 |
|
|
| 10 Apr 2015 07:22 PM |
| UIS is awesome but looks like trash and isn't user friendly |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 10 Apr 2015 07:25 PM |
'looks like trash and isn't user friendly'
>unexperienced scripter |
|
|
| Report Abuse |
|
|
oplmn1
|
  |
| Joined: 25 Nov 2010 |
| Total Posts: 994 |
|
|
| 10 Apr 2015 07:26 PM |
| I'm not inexperienced and will use it in the future I just think it looks really terrible. Also could you quick tell me how to stop the input from when your typing? |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 10 Apr 2015 07:30 PM |
local UIS = game:GetService('UserInputService')
UIS.InputBegan:connect(function(input, gameProcessedEvent) if not gameProcessedEvent then if input.KeyCode == Enum.KeyCode.B then print('pressing B, but not while typing') end end end)
--
the second line in the function checks to make sure the local player isn't typing
|
|
|
| Report Abuse |
|
|
|
| 10 Apr 2015 07:32 PM |
Ummm, don't you mean the 1st line in the function? The 2nd line in the function is:
if input.KeyCode == Enum.KeyCode.B then
lol |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 10 Apr 2015 07:37 PM |
oops
sorry about that
first line in the function :) |
|
|
| Report Abuse |
|
|