local player = game.Players.LocalPlayer local mouse = player:GetMouse() mouse:connect(function(key) if key == "Q" then print("this is local") end end)
basically this simple script just does not work, i don't know what is wrong used to work before
You're almost right.
'KeyDown' is getting deprecated!
The new method is UserInputService.
Here is a good method on using it.
New Code:
game:GetService("UserInputService").InputBegan:connect(function(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.Q then print("Q was pressed") end end)
The answer is no, :GetMouse()
is no getting deprecated.
But Mouse
is outdated, there are others which have more features, like
UserInputService
and ContextActionService
.
https://developer.roblox.com/articles/Keyboard-Input-Methods
There are still ways to use :GetMouse()
like Mouse.Target
and Mouse.TargetSurface
and many others which can be very useful, you can see all of them by going to the object browser and look for Mouse
.