Help my script please

if KeyBinds[Key.KeyCode] then – Not working
KeyBinds[KeyCode] (true)
end

local KeyCode = Enum.KeyCode
local W, A, S, D, E, Q

local KeyBinds = {
	-- Throttle
	KeyCode.E == function(Bool)
		E = Bool
	end,
	KeyCode.Q == function(Bool)
		Q = Bool
	end,

	-- Turn
	KeyCode.A == function(Bool)
		A = Bool
	end,
	KeyCode.D == function(Bool)
		D = Bool
	end,

	-- Go
	KeyCode.W == function(Bool)
		W = Bool
	end,
	KeyCode.S == function(Bool)
		S = Bool
	end,
}


UserInputService.InputBegan:Connect(function(Key, Progress)
	if Progress then return end

	if KeyBinds[Key.KeyCode] then -- Not working
		KeyBinds[Key](true)
	end
end)

Use one equals sign not 2 [][][][][][]

1 Like

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