local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() Mouse.KeyDown:connect(function(key) if key == "e" then print("e pressed") end end)
This LocalScript is cloned and put into PlayerGui when a new player joins, and I've ensured that I'm cloning it correctly and everything and it just seems to refuse to do what I want it to, or seemingly run at all.
Is there some other event I should be using for key presses? I've been stuck trying to get this LocalScript to work for a large part of the day.
Use UserInputService, KeyDown is practically deprecated now.
Link on how to use it: http://www.roblox.com/UserInputService-Example-item?id=247466751
Wiki:http://wiki.roblox.com/index.php?title=Gamepad_input#UserInputService_events
Well, KeyDown is depreciated but you can still do this: