My script is pretty simple, i'm just trying to print something whenever i press either the W or the S key using the "or" function along with InputBegan, For some reason though, the code prints whenever i press any key on the keyboard not just W or S.
local W = Enum.KeyCode.W local S = Enum.KeyCode.S local UIS = game:GetService('UserInputService') UIS.InputBegan:Connect(function(input) if input.KeyCode == W or S then print('working') end end)
I really don't understand why it doesn't work when it seems like it should...
the problem is that you didn't write the whole thing again, heres the script:
local W = Enum.KeyCode.W local S = Enum.KeyCode.S local UIS = game:GetService("UserInputService") UIS.InputBegan:Connect(function(Input) if Input.KeyCode == W or input.KeyCode == S then print("working") end end)