#Enum.KeyCode

25 messages · Page 1 of 1 (latest)

hidden condor
#

im trying to figure out how the: Enum.KeyCode
works

#

cuz im trying to make when u hit the key E u scale down

proud remnant
#

Enum.Keycode brings a list of all of the key codes and you can do Enum.Keycode.E

hidden condor
proud remnant
#

search up user input server

#

I mean

#

Service

patent ferry
#
local Key = "E"
local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode[Key] then
        -- code here
    end
end)
-- or
-- I suggest using the second one unless you want to be able to change the key that it uses
UserInputService.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.E then
        -- Code here
    end
end)
quasi jewel
#

@hidden condor

#

Look Up.

hidden condor
#

hmm

hidden condor
#

it aint working idk whats wrong

patent ferry
#

Remove one

#

Only keep one

#

Move the other if statement under the enum.keycode.e

hidden condor
#

still doesnt work lol

patent ferry
#

It shouls

honest cryptBOT
#

studio** You are now Level 5! **studio

patent ferry
#

Is it a localscript

hidden condor
honest cryptBOT
#

studio** You are now Level 4! **studio

hidden condor
#

idk its weird