Create a cooldown on lua

So, i want to make sprint enabled for donators on ttt, though not infinite
I want it to have a cooldown, what lua code would i need for that? also how could i add the cooldown meter to the hud?

I will be using the USE key for sprint since shift is team chat

Why in gods name would you make shift team chat. That’s the sprint key in pretty much every fps game I have played…

I didn’t make shift team chat, the maker of ttt did?

Change the team chat to something else, such as holding T. Then use shift for sprint. To have a “cooldown” for sprint, I’d recommend coding a stamina system. From there, you should code it to have vars that can be changed such as:

[lua]// While sprinting, how much stamina is lost per tick

// How much stamina lost when jumping

// How much stamina to regain while walking normally

// How much stamina to regain when standing still

// How much stamina to regain when crouching ( ow, this hurts )

Those are some, but not all of my vars, but they should be enough to give you an idea of some of the logic.