I have seen games where you press "E" to eat and stuff, is there a thing I could use to detect what players press on their keyboards?
You can use the UserInputService
!
http://wiki.roblox.com/?title=API:Class/UserInputService
Example:
game:GetService("UserInputService").InputBegan:connect(function(input,proc) if not proc then --checks if not using chat if input.KeyCode == Enum.KeyCode.E then --Do stuff. end end end)
hope this helped! ~KIHeros :) (If it did please accept!)
An easier way of doing that ^..
wait() local player = game.Players.LocalPlayer local mouse = player:GetMouse() mouse.KeyDown:connect(function(key) print(key) end)