✓ Accepted answer
No one uses or should use that way of scripting keyboard stuff, not sure if that's correct but I know what you mean.
Now, if you want to know what input the player is doing, we use UserInputService and it's pretty simple. Now to set up this, You should make a variable of the Service.
Look bellow for the localscript and under that, information about it:
local UserInput = game:GetService("UserInputService")
UserInput.InputBegan:connect(function(Pressed)
if Pressed.KeyCode == Enum.KeyCode.F then
end
end)
First, I used Pressed in the parameter, this just return what Input the player has done.
Then we want to check if the given input is F, as you see here if Pressed.KeyCode == Enum.KeyCode.F then
Comment any questions, otherwise accept the answer!
1 comment
Look up UserInputService. They are using a new system that will support mobile devices and PC