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: How do I compare Enum.KeyCode.One to "1"?

Previous Thread :: Next Thread 
Firebrand1 is not online. Firebrand1
Joined: 12 Feb 2009
Total Posts: 2692
02 Oct 2016 03:41 PM
I want to know if a the InputObject matches the variable string.

How do I get "A" from Enum.KeyCode.A, etc?
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
02 Oct 2016 03:42 PM
Enum.KeyCode.A.Name
Report Abuse
Firebrand1 is not online. Firebrand1
Joined: 12 Feb 2009
Total Posts: 2692
02 Oct 2016 03:43 PM
Oh there we go, thanks :)
Report Abuse
Firebrand1 is not online. Firebrand1
Joined: 12 Feb 2009
Total Posts: 2692
02 Oct 2016 03:45 PM
I don't suppose there's anyway to get "4" from "Four"?
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
02 Oct 2016 03:46 PM
local uis = game:GetService('UserInputService')

uis.InputBegan:connect(function(input,event)
if event then return end
local key,enum = input.KeyCode,Enum.KeyCode
if key == enum['A'] then
print('A')
end
end)


Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
02 Oct 2016 03:46 PM
Flux that's literally (nearly) the same thing I wore in 2012 and for a second I thought I was on gametest


Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
02 Oct 2016 04:16 PM
'I don't suppose there's anyway to get "4" from "Four"?'
Here's one way:
Enum.KeyCode.NUMBER.Value - 48

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