I have been trying on finding a way that you could limit the holding time and when the player release their key, it will return a total value of the time that they were holding.
But I have been using RunService and I don’t think checking tick() to frequently just for the limit is not a good performance.
I don’t think I can think someother way to do this? Can you suggest me some ideas. Don’t give a well-scripted code, I would be like to take an example piece of code but don’t give me a well-scripted code please.
Assuming you are using UserInputService for your input, the way I typically do something like that is taking advantage of the InputBegin and InputEnded events. See here for more info So you’d want some kind of boolean variable and when InputBegins, set it to true then do a while/repeat/for loop (whichever is best for your purposes) and then when that variable changes to false, you break out of the loop. In the InputEnded event, you would set that variable to false so whenever they stop holding down it triggers that conditional.