|
| 19 Dec 2012 11:29 AM |
| What would I use in a script to check if the player double-tapped a key? For example, if they double-tap "W" they sprint. |
|
|
| Report Abuse |
|
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 19 Dec 2012 11:33 AM |
wtap = false script.Parent.Selected:connect(function(mouse) mouse.KeyDown:connect(function(key) key = key:lower() if key == "w" then if wtap == false then wtap = true wait(0.2) wtap = false else print("DoubleTapped W") wtap = false doublewtap = true end end end) end) |
|
|
| Report Abuse |
|
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 19 Dec 2012 11:34 AM |
| if there is a gap of over 0.2 seconds between first and second tap, it doesn't count |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Dec 2012 02:16 PM |
| How would I get it to find which player tapped it? |
|
|
| Report Abuse |
|
|
| |
|