Keystatechange Updating without a timer?
#1

Hello,
I was wondering if someone know how to code this thing.
How could I keep updating the bar without timers when a player is holding the button? I know its possible but can't think of a way on that, can anyone help me?
Reply
#2

You can check if it is pressed in OnPlayerUpdate, and then use tickcount() to find out how long it is pressed/how long since the last OnPlayerUpdate, if needed.
Reply
#3

Also timers are not such a bad thing at all. It all depends on HOW you use it. Looking for certain keys like Up Down Left Right(those cannot be checked with OnPlayerKeyStateChange), I would recommend a timer (or OnPlayerUpdate but then I'd schedule it so it only checks every 250ms or something). Savings accounts would be a bad example of using a timer for.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)