ply.SetRunSpeed, scoreboard, entities and animation issues


I’m trying to implement a script to slow down the player if they sprint too long (stamina bar) and no matter how I try to code it their speed never decreases:
— cl.init—
if (StaminaVal <0.1) then
RunConsoleCommand (“awbdh5w4wt5gsrteyqqw3464756w43ege5y453256”,1)
elseif (StaminaVal > 0.2 ) then
RunConsoleCommand (“awbdh5w4wt5gsrteyqqw3464756w43ege5y453256”,0)

function slooooow (ply)
print (player.slow)
if (player.slow == 1.00) then
if (player.slow == 0.00) then

hook.Add(“PlayerFootstep”, “slow”, slooooow)

function initSlow (ply, command, args)
player.slow = args[1]

(Yes I know I need to use user messages instead at a later date)

If I want to create my own scoreboard, is it derma related and what hooks will I need to use to overwrite the standard one (or do I block the standard one and just somehow bind the standard key to this)?

Any idea on how to change the image that is displayed in the Q menu under entities for a specific entity, I can’t find any help on the wiki for this.

I have also got an issue with animations, is there a quick fix for player models as from what I’m told NPC animations simply T pose when put onto players, yet I see servers get away with this without the individual models being re-rigged?

All help will be greatly appreciated.

Epic console command names. Just a heads up, the SetRunSpeed function also sets the walking speed so you’ll have to make a work around. As for the score board, that will get rid of it and will allow you to put your own in. This is another useful link

Setting walking speed doesn’t set run speed, or does it? Also even though I’m sprinting when the bar goes <1 I don’t go any slower despite setting a lower run value.

Setting a walking speed does not set a run speed, and vice versa, they’re completely different.

I do it by making a timer, and check if the player’s velocity length > 1 and if they have shift held down, start decreasing stamina from 100, and if it’s at 0, start bringing it back up.

Actually decreasing my bar works fine, its just I can’t make them move any slower when its <0.1