✓ Accepted answer
Hello! I'm BlackOrange3343 and I'll be helping you today.
I'm not sure why there is a "sudden" malfunction in your script that worked a while ago but let me suggest a couple things.
UserInputService should be done on the Client. (Local Script)
- Your local script should be in a place that will let the local script run. A few examples are
StarterGui, StarterCharacterScripts,StarterPlayerScripts.
- Make sure the script is not Disabled
After you made sure all these are done and still doesn't function then:
Add a new LocalScript into StarterGui.
Next copy paste this:
local UIS = game:GetService('UserInputService')
UIS.InputBegan:Connect(function(Input, IsTyping)
if Input.KeyCode == Enum.KeyCode.F then
print('F has been pressed')
end
end)
If it prints then it means it works, then you can edit the script from there to your likings.
Hopfully this helped.
Best of luck developer!
PS: If it errors comment and tell me