Im trying to make a simple movement script. In the code below I list out all the keys that will trigger movement below in a table. Below that is the event, in the event it tries to check whether or not the input given is inside the table. For some reason, it doesn’t work, but it worked when I was using a dictionary table instead. Any suggestions?
local MovementKeys = {
Enum.KeyCode.W,
Enum.KeyCode.A,
Enum.KeyCode.S,
Enum.KeyCode.D
}
UIS.InputBegan:Connect(function(Input)
if MovementKeys[Input.KeyCode] then
print "test"
end
end)