Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to get Key Press By known person with UserInputService?

Asked by 9 years ago

Of course if you:

print(game:GetService("UserInputService"):IsKeyDown() --a Random KeyCode Here

then you'll get that someone pressed a key. But who? How to find out who is pressing the keys? It would be useful, 'cause Getting Keyboard Input works bad, so I wanted to replace it with this.

Thanks,

SwaggyDuckie.

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

UserInputService should only be used in a localscript anyways.

So you can just index the LocalPlayer of game.Players

local plr = game.Players.LocalPlayer
Ad

Answer this question