GetKeysPressed() doesn't seem to work, what am I doing wrong?

Hello.

I’m trying to print something in the output when the following conditions are met:

  • Player has pressed Q
  • Player has to be near the ground
  • Player is holding atleast one of the directional keys (AWSD)
This is how I'm currently making my attempt

This is the output (The keys printed, 1 to 4 are the directional keys as table, which I passed into the local function as a value)

image

However, it only comes as far as printing the type of the values given in the local function.
I don’t know why this happens.
I have tried multiple things, including iterating over :GetKeysPressed() itself, which printed nothing, for reasons unknown.
Using UserInputService:IsKeyDown() gave me a similair result; printed nothing.
(ofcourse I didn’t treat the function as a table at that time)

Is there something I’m overlooking?

2 Likes

Fixed, what did I do?

I forgot this module was stored on the server.
UserInputService doesn’t work on the server.

Error message would’ve been nice.

5 Likes