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: KeyCode

Previous Thread :: Next Thread 
inception101 is not online. inception101
Joined: 19 Dec 2010
Total Posts: 738
10 Feb 2017 08:19 PM
What's the keycode of 1 on the keyboard?


Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
10 Feb 2017 08:23 PM
just do

Enum.KeyCode.One and you should see the value in the auto-complete thing


Report Abuse
inception101 is not online. inception101
Joined: 19 Dec 2010
Total Posts: 738
10 Feb 2017 08:26 PM
InputBegan = coroutine.create(function(input)
while true do
print(input)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.One then
--do stuff (its not doing stuff)
end
end
coroutine.yield(InputBegan)
end
end)

function ConnectInputBegan(input)
coroutine.resume(InputBegan, input)
end
UserInputService.InputBegan:connect(ConnectInputBegan)

Why does it print "InputObject" everytime. Also why it no work? :(


Report Abuse
LilMcManiac is not online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
10 Feb 2017 08:27 PM
why is this a coroutine?
Report Abuse
inception101 is not online. inception101
Joined: 19 Dec 2010
Total Posts: 738
10 Feb 2017 08:29 PM
Because I want to add a timer to how long the player holds down a button, and I was going to make a variable keeping track of the state based on the InputBegan and InputEnded functions to set it to its appropriate state, but I also remembered that you can't execute 2 functions at once. Thats why I made it a coroutine


Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
10 Feb 2017 10:11 PM
"while true do"

NOOOOOOOO


filteringenabled or riot
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