Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i fix the keycode is not a valid member error?

local player = game:GetService("Players").LocalPlayer

local rp = game:GetService("ReplicatedStorage")
local summon = rp:WaitForChild("Summon")

local uis = game:GetService("UserInputService")

local isactive = false
local debounce = false
local cd = 1

uis.InputBegan:connect(function(Input,istyping)
	if istyping then
		return
	elseif Input.KeyCode == Enum.keycode.Q then
		if debounce == false and isactive == false then
			isactive = true
			debounce = true

			summon:fireserver(isactive)
			wait(cd)
			debounce = false
		elseif debounce == false and isactive == true then
			isactive = false
			debounce = false

			summon:fireserver(isactive)
			wait(cd)
			debounce = false
		end
	end
end)

ERROR:keycode is not a valid member of "Enum"   Line:15

1 answer

✓ Accepted answer

Enum.keycode.Q

The "keycode" is all lowercase, it has to be respectively written.

Replace it with "Enum.KeyCode.Q"

1 comment

0

oh ok thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.