All of the other localscripts I use userinputservice with work online, but this one specifically doesn't and only works in studio.
local k = script.Parent:WaitForChild("PauseMenuGuiEnabler")
function onKeyPress(inputObject, gameProcessedEvent)
k.Value = k.Value + 1
if inputObject.KeyCode == Enum.KeyCode.Tab then
print("k.value")
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)

3 comments
What is the script's Parent?
@Goulstem The parent is StarterGui
What about it doesn't work? If you want it to print the value, get rid of the Quotations, as it is just a string right now.