Ive tried something like this aint I don't think it works. There is no output.
01 | local keys = { |
02 | "A" ; |
03 | "D" ; |
04 | } |
05 |
06 | uis.InputBegan:connect( function (key, process) |
07 | if key.KeyCode = = keys [ key ] then |
08 | -- |
09 | end |
10 | end ) |
You were close. Do something like this:
01 | local keys = { |
02 | Enum.KeyCode.A; |
03 | Enum.KeyCode.D; |
04 | } |
05 |
06 | uis.InputBegan:connect( function (key, process) |
07 | if table.find(keys, input.KeyCode) then |
08 | -- |
09 | end |
10 | end ) |
You can try a for loop and check if any values match the key.
1 | local keys = { "A" , "D" } |
2 |
3 | uis.InputBegan:Connect( function (key,process) |
4 | for i,v in pairs (keys) do |
5 | if v = = key.KeyCode then |
6 | ----- |
7 | break |
8 | end |
9 | end ) |