okay I want a player to press a letter but I don't want it In a tool or anything I just want it to be you press a letter then I write my code of what I want to happen. Trust me I seached it up and I found some script that people said worked but they didn't when I tested them. Please don't down vote i seached it up here on the site and I found nothing. It would help if you explained it to me, what you did in the script.
Please help!
Try this:
player = game.Players.LocalPlayer mouse = player:GetMouse() mouse.KeyDown:connect(function(key) if key == "q" then -- do stuff end end
I prefer using the UserInputService to get when a key is pressed because the mouse fires later and sometimes doesn't fire if you press and release fast enough like this
function KeyDown(key) print("The "..key.." key was pressed") end local ui=game:GetService("UserInputService") ui.InputBegan:connect(function(obj) if obj.KeyCode~=nil then local K=string.char(obj.KeyCode) KeyDown(K) end end)