generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: When using Userinputservice

Previous Thread :: Next Thread 
xshot23 is not online. 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
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
08 Dec 2015 04:33 PM
input began
wait a second, check if they're still holding it
Report Abuse
IllegallyBlind is not online. IllegallyBlind
Joined: 07 Nov 2010
Total Posts: 1691
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
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
08 Dec 2015 05:05 PM
@Illegal
Rec is not wrong at all. It is a simplex answer and a simplex question.
Report Abuse
IllegallyBlind is not online. IllegallyBlind
Joined: 07 Nov 2010
Total Posts: 1691
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
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
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
IllegallyBlind is not online. IllegallyBlind
Joined: 07 Nov 2010
Total Posts: 1691
08 Dec 2015 05:08 PM
An incorrect and incomplete response is more misleading than no response at all
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
08 Dec 2015 05:11 PM
Sure.

Revision to my initial response: use inputended too
Report Abuse
Locard is not online. 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
IllegallyBlind is not online. IllegallyBlind
Joined: 07 Nov 2010
Total Posts: 1691
08 Dec 2015 05:44 PM
^ above

You make me wanna rip my face off
Report Abuse
litalela is not online. 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 is not online. 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
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
09 Dec 2015 03:28 PM
he's rude to me too austin ;(
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image