ply.SetRunSpeed, scoreboard, entities and animation issues

ply.SetRunSpeed:

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—
[lua]
if (StaminaVal <0.1) then
RunConsoleCommand (“awbdh5w4wt5gsrteyqqw3464756w43ege5y453256”,1)
elseif (StaminaVal > 0.2 ) then
RunConsoleCommand (“awbdh5w4wt5gsrteyqqw3464756w43ege5y453256”,0)
end
[/lua]

—init.lua—
[lua]
function slooooow (ply)
print (player.slow)
if (player.slow == 1.00) then
ply:SetRunSpeed(200)
end
if (player.slow == 0.00) then
ply:SetRunSpeed(400)
end
end

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

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

concommand.Add(“awbdh5w4wt5gsrteyqqw3464756w43ege5y453256”,initSlow)
[/lua]
(Yes I know I need to use user messages instead at a later date)

Scoreboard:
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)?

Entities:
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.

Animations:
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, http://wiki.garrysmod.com/?title=Gamemode.HUDDrawScoreBoard that will get rid of it and http://wiki.garrysmod.com/?title=Gamemode.ScoreboardShow will allow you to put your own in. This is another useful link http://wiki.garrysmod.com/?title=Gamemode_Hooks

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