xshot23
|
  |
| Joined: 17 Oct 2014 |
| Total Posts: 4873 |
|
|
| 08 Dec 2015 04:28 PM |
how would i let a function running
if a certain key is being held down?
http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$7 Tx60 |
|
|
| Report Abuse |
|
|
|
| 08 Dec 2015 04:33 PM |
input began wait a second, check if they're still holding it |
|
|
| Report Abuse |
|
|
|
| 08 Dec 2015 05:01 PM |
Recurring this is why people think you're an idiot
Your response to his question was absolute poison |
|
|
| Report Abuse |
|
|
|
| 08 Dec 2015 05:05 PM |
@Illegal Rec is not wrong at all. It is a simplex answer and a simplex question. |
|
|
| Report Abuse |
|
|
|
| 08 Dec 2015 05:06 PM |
The real answer doesn't involve repeated checking
His answe didn't even involve the use of input ended |
|
|
| Report Abuse |
|
|
|
| 08 Dec 2015 05:07 PM |
| I assumed he knew how to use UserInputService. A response is better than no response from you |
|
|
| Report Abuse |
|
|
|
| 08 Dec 2015 05:08 PM |
| An incorrect and incomplete response is more misleading than no response at all |
|
|
| Report Abuse |
|
|
|
| 08 Dec 2015 05:11 PM |
Sure.
Revision to my initial response: use inputended too |
|
|
| Report Abuse |
|
|
Locard
|
  |
| Joined: 13 Apr 2014 |
| Total Posts: 3516 |
|
|
| 08 Dec 2015 05:15 PM |
This is a VERY VERY SIMPLE version of what you would be talking about. Note that E has to be let go around the interval of 5 seconds to stop the currently running function. I could script that as well if you want.
function func() print('function is running!') while true do wait(5) if not game:GetService'UserInputService':IsKeyDown(Enum.KeyCode.E) then break else print('E is still being pressed, continuing!') end end end
game:GetService'UserInputService'.InputBegan:connect(function(input,gpe) if not gpe then if input.KeyCode == Enum.KeyCode.E then func() end end end) |
|
|
| Report Abuse |
|
|
|
| 08 Dec 2015 05:44 PM |
^ above
You make me wanna rip my face off |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 08 Dec 2015 05:48 PM |
http://wiki.roblox.com/index.php?title=API:Class/UserInputService/IsKeyDown
god
➳Lɪᴛᴀʟᴇʟᴀ ɪs ᴍʏ ɴᴀᴍᴇ, Lᴜᴀ ɪs ᴍʏ ɢᴀᴍᴇツ |
|
|
| Report Abuse |
|
|
Locard
|
  |
| Joined: 13 Apr 2014 |
| Total Posts: 3516 |
|
|
| 08 Dec 2015 10:51 PM |
@IllegallyBlind
Yeah, it's horrible coding. I typed something up for him to be able to learn easily. No need for the insults, please. |
|
|
| Report Abuse |
|
|
|
| 09 Dec 2015 03:28 PM |
| he's rude to me too austin ;( |
|
|
| Report Abuse |
|
|
|
| 09 Dec 2015 03:33 PM |
| He just doesn't know how to do this, so he deceives himself into pretending he's still superior somehow. I think it's called denial. |
|
|
| Report Abuse |
|
|