In a local script that I am working on there is a section that is suppose to find what key was pressed then see if it is the key that is suppose to be pressed in a textBox e.g user types in something then when he is done he clicks the outside to remove the cursor and presses "r", but it is not working. I don't get any error codes or anything.
local Player = game.Players.LocalPlayer -- for the key down events
local Mouse = Player:GetMouse()
function rButtonCheck() -- checks to see if the user pressed 'r'
if button == "r" then
print("player pressed return")
end
end
Mouse.KeyDown:connect(rButtonCheck,button)
