Multiple Useable KeyCodes?

How could I make it so that you can press multiple keycodes and still have it function the same?
I tried to put it into a table like this but it didn’t seem to work, anything else I could do?

local availablekeys = {Enum.KeyCode.E,Enum.KeyCode.Space,Enum.KeyCode.Q,Enum.KeyCode.F,Enum.KeyCode.Return,Enum.KeyCode.Escape}
	userInput.InputBegan:Connect(function(key)
		if key.KeyCode == availablekeys then
			local tween = ts:Create(camera, TweenInfo.new(1), {CFrame = oldCam})
			print("Play tween")
			tween:Play()
			tween.Completed:Wait()
			clickDectector.MaxActivationDistance = 32
			camera.CameraType = Enum.CameraType.Custom
			Controls:Enable()
		end
	end)

Just change it to

if table.find(availablekeys, key.KeyCode) then

Since it is a table, and not a keycode itself.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.