Also how can i make some value rapidly increase while that button is being held?
✓ ANSWER ACCEPTED
How can i check if a certain hotkey is being held, and when is it released?
1 answer
✓ Accepted answer
The answer is pretty simple. You can use the service "UserInputService" to sense when a key is being pressed. For example:
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(key) -- Senses when a key is pressed
if key == Enum.Key.Q then --Change Q to any key
--Code
end
end)
UserInputService.InputEnded:Connect(function(key) -- Senses when a key is let go
if key == Enum.Key.Q then --Change Q to any key
--Code
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
Forgot to mention but you can constantly fire a remote event to increase the value
Thanks a lot that's exactly what i needed, could you also send me a link to the developer wiki explaining the whole user input service, i couldn't find it by myself
Sure, of course!
https://developer.roblox.com/en-us/api-reference/event/UserInputService/InputBegan and https://developer.roblox.com/en-us/api-reference/event/UserInputService/InputEnded
I'm thankful