TTT Spriting / Stamina Bar

first, excuse me for my english due it is not my native language.
I’m LOOKING FOR ADDONS TTT Spriting / Stamina Bar anyone know any or know somo code of this ?

something like this

It was on code hire part of some add-on called enhanced / advanced TTT or something like that.

Does anyone know?

up pls

Found this on another face punch post, place it in gmodserver\garrysmod\lua\autorun. Im not sure if it works but go ahead and test it.
Download: http://www.mediafire.com/download/71uqdr795mqpuz1/stamina.lua


if CLIENT then
    if not FStaminaToggled then
        function FStamina_Draw()
            if LocalPlayer():GetNWInt( "FStamina" ) then
                if LocalPlayer():Alive() then
                    local Fx = ( ScrH()/23.272727272727272727272727272727 )
                    local Fy = ( ScrH()/1.0385395537525354969574036511156 )
                    local Fx = ( ScrW()/6.7368421052631578947368421052632 )
                    local Fy = ( ScrH()/146.28571428571428571428571428571 )
                    draw.RoundedBox( 4, Fx, Fy, Fx, Fy, Color( 90, 90, 90, 255 ) )
                    if LocalPlayer():GetNWInt( "FStamina" ) > 1 then
                        draw.RoundedBox( 4, Fx, Fy, Fx*( LocalPlayer():GetNWInt( "FStamina" )/100 ), Fy, Color( 255, 242, 0, 255 ) )
                    end
                end
            end
        end
        hook.Add( "HUDPaint", "FStamina_Draw", FStamina_Draw )
    end
end
 
if SERVER then
    if not FStaminaToggled then
        function FStamina_Spawn( ply )
            ply:SetNWInt( "FStamina", 100 )
        end
        hook.Add( "PlayerSpawn", "FStamina_Spawn", FStamina_Spawn )
 
        function FStamina_MainThink()
            for k, ply in pairs( player.GetAll() ) do
                if ply:GetNWInt( "FStamina" ) < 0 then ply:SetNWInt( "FStamina", 0 ) end
                if ply:GetNWInt( "FStamina" ) > 100 then ply:SetNWInt( "FStamina", 100 ) end
 
                if ply.LastHealth and ply.LastHealth > ply:Health() then
                    local damage = ( ply.LastHealth - ply:Health() )*2
                    ply.LastHealth = ply:Health()
                    ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" ) - damage )
                elseif not ply.LastHealth then
                    ply.LastHealth = ply:Health()
                end
 
                if ply:GetMoveType() ~= MOVETYPE_NOCLIP then
                    if ( ply:KeyDown( IN_SPEED ) or ply:KeyPressed( IN_SPEED ) ) and ply:GetNWInt( "FStamina" ) > 0 then
                        ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ply:GetRunSpeed()/12000 ) ) )
                        ply.LastFStamina = CurTime() + 3
 
                        if ply:KeyPressed( IN_JUMP ) and ply:GetNWInt( "FStamina" ) > 0 then
                            ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-10 )
                            ply.LastFStamina = CurTime() + 3
                        end
 
                        if ply:WaterLevel() == 3 then
                            ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ( ply:GetRunSpeed()/12000 )*1.6 ) ) )
                        end
 
                    elseif ply:KeyPressed( IN_JUMP ) and ply:GetNWInt( "FStamina" ) > 0 then
                        ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-10 )
                        ply.LastFStamina = CurTime() + 3
 
                        if ply:WaterLevel() == 3 then
                            ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ( ply:GetRunSpeed()/12000 )*1.6 ) ) )
                        end
 
                    elseif ( ply:KeyDown( IN_FORWARD ) or ply:KeyDown( IN_BACK ) or ply:KeyDown( IN_MOVELEFT ) or ply:KeyDown( IN_MOVERIGHT ) ) and ply:GetNWInt( "MStamina" ) > 0 then
                        if ply:GetMoveType() == MOVETYPE_LADDER or ply:WaterLevel() == 1 then
                            ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ( ply:GetRunSpeed()/12000 )*1.2 ) ) )
                        elseif ply:WaterLevel() == 3 then
                            ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ( ply:GetRunSpeed()/12000 )*1.6 ) ) )
                        end
 
                    elseif ply.LastMStamina and ply.LastMStamina < CurTime() then
                        if ply:IsOnGround() and ply:WaterLevel() == 0 then
                            ply:SetNWInt( "FStamina", ply:GetNWInt( "MStamina" )+2 )
                        elseif ply:WaterLevel() == 1 then
                            ply:SetNWInt( "FStamina", ply:GetNWInt( "MStamina" )+3 )
                        end
 
                        ply:SetRunSpeed( ply.FRunSPeed )
                        ply:SetJumpPower( ply.FJumpPower )
                        ply.FRunSPeed = nil
                        ply.FJumpPower = nil
 
                    elseif ply:GetNWInt( "FStamina" ) <= 0 and ( ply:GetRunSpeed() > 0 or ply:GetJumpPower() > 0 ) then
                        ply.FRunSpeed = ply:GetRunSpeed()
                        ply.FJumpPower = ply:GetJumpPower()
                        ply:SetWalkSpeed( 250 )
                        ply:SetRunSpeed( ply:GetWalkSpeed() )
                        ply:SetJumpPower( 0 )
                    end
 
                    if ply:KeyDown( IN_SPEED ) and ply:GetNWInt( "FStamina" ) <= 0 then
                        ply:SetRunSpeed( ply:GetWalkSpeed() )
                    end
                end
            end
        end
        hook.Add( "Think", "FStamina_MainThink", FStamina_MainThink )
    end
end
 
function FStamina_Toggle()
    if FStaminaToggled then
        FStaminaToggled = false
    else
        FStaminaToggled = true
    end
end
concommand.Add( "FanStamina_toggle", FStamina_Toggle )

function FStamina_Regen()
	for k, v in pairs(player.GetAll()) do
		if (v:GetMoveType() ~= MOVETYPE_NOCLIP) and (!v:KeyDown(IN_SPEED)) and (!v:KeyDown(IN_JUMP)) and (!v:KeyDown(IN_FORWARD)) and (!v:KeyDown(IN_BACK)) and (!v:KeyDown(IN_MOVELEFT)) and (!v:KeyDown(IN_MOVERIGHT)) then
			local Stam = v:GetNWInt("FStamina")
			if v:IsOnGround() and v:WaterLevel() == 0 then
				v:SetNWInt( "FStamina", math.Clamp(Stam+2, 0, 100))
			elseif v:WaterLevel() == 1 then
				v:SetNWInt( "FStamina", math.Clamp(Stam+3, 0, 100))
			end
		end
	end
end
timer.Create("FStamina_Regen", 0.5, 0, FStamina_Regen)

I had already tried this, but it’s not the same, it’s just to jump. I want something to run

Advanced TTT has its own sprint and stamina bar. Look into that.

where i download it ?

It’s for sale, or was?

It was on CoderHire but can’t buy it anymore.

fk But what you can not find in another place?

The script Nick posted works, I tested it.
Though, you should edit how much the energy drains, it’s really slow…

Just kidding, did it for you (and removed jump reduce)



if CLIENT then
    if not FStaminaToggled then
        function FStamina_Draw()
            if LocalPlayer():GetNWInt( "FStamina" ) then
                if LocalPlayer():Alive() then
                    local Fx = ( ScrH()/23.272727272727272727272727272727 )
                    local Fy = ( ScrH()/1.0385395537525354969574036511156 )
                    local Fx = ( ScrW()/6.7368421052631578947368421052632 )
                    local Fy = ( ScrH()/146.28571428571428571428571428571 )
                    draw.RoundedBox( 4, Fx, Fy, Fx, Fy, Color( 90, 90, 90, 255 ) )
                    if LocalPlayer():GetNWInt( "FStamina" ) > 1 then
                        draw.RoundedBox( 4, Fx, Fy, Fx*( LocalPlayer():GetNWInt( "FStamina" )/100 ), Fy, Color( 255, 242, 0, 255 ) )
                    end
                end
            end
        end
        hook.Add( "HUDPaint", "FStamina_Draw", FStamina_Draw )
    end
end
 
if SERVER then
    if not FStaminaToggled then
        function FStamina_Spawn( ply )
            ply:SetNWInt( "FStamina", 100 )
        end
        hook.Add( "PlayerSpawn", "FStamina_Spawn", FStamina_Spawn )
 
        function FStamina_MainThink()
            for k, ply in pairs( player.GetAll() ) do
                if ply:GetNWInt( "FStamina" ) < 0 then ply:SetNWInt( "FStamina", 0 ) end
                if ply:GetNWInt( "FStamina" ) > 100 then ply:SetNWInt( "FStamina", 100 ) end
 
                if ply.LastHealth and ply.LastHealth > ply:Health() then
                    local damage = ( ply.LastHealth - ply:Health() )*2
                    ply.LastHealth = ply:Health()
                    ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" ) - damage )
                elseif not ply.LastHealth then
                    ply.LastHealth = ply:Health()
                end
 
                if ply:GetMoveType() ~= MOVETYPE_NOCLIP then
                    if ( ply:KeyDown( IN_SPEED ) or ply:KeyPressed( IN_SPEED ) ) and ply:GetNWInt( "FStamina" ) > 0 then
                        ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ply:GetRunSpeed()/1000 ) ) )
                        ply.LastFStamina = CurTime() + 3
 
                      
 
                        if ply:WaterLevel() == 3 then
                            ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ( ply:GetRunSpeed()/12000 )*1.6 ) ) )
                        end
 
                   
 
                    elseif ( ply:KeyDown( IN_FORWARD ) or ply:KeyDown( IN_BACK ) or ply:KeyDown( IN_MOVELEFT ) or ply:KeyDown( IN_MOVERIGHT ) ) and ply:GetNWInt( "MStamina" ) > 0 then
                        if ply:GetMoveType() == MOVETYPE_LADDER or ply:WaterLevel() == 1 then
                            ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ( ply:GetRunSpeed()/12000 )*1.2 ) ) )
                        elseif ply:WaterLevel() == 3 then
                            ply:SetNWInt( "FStamina", ply:GetNWInt( "FStamina" )-( ( ( ply:GetRunSpeed()/12000 )*1.6 ) ) )
                        end
 
                    elseif ply.LastMStamina and ply.LastMStamina < CurTime() then
                        if ply:IsOnGround() and ply:WaterLevel() == 0 then
                            ply:SetNWInt( "FStamina", ply:GetNWInt( "MStamina" )+2 )
                        elseif ply:WaterLevel() == 1 then
                            ply:SetNWInt( "FStamina", ply:GetNWInt( "MStamina" )+3 )
                        end
 
                        ply:SetRunSpeed( ply.FRunSPeed )
                        ply.FRunSPeed = nil
 
                    elseif ply:GetNWInt( "FStamina" ) <= 0 and ( ply:GetRunSpeed() > 0) then
                        ply.FRunSpeed = ply:GetRunSpeed()
                        ply:SetWalkSpeed( 250 )
                        ply:SetRunSpeed( ply:GetWalkSpeed() )
                    end
 
                    if ply:KeyDown( IN_SPEED ) and ply:GetNWInt( "FStamina" ) <= 0 then
                        ply:SetRunSpeed( ply:GetWalkSpeed() )
                    end
                end
            end
        end
        hook.Add( "Think", "FStamina_MainThink", FStamina_MainThink )
    end
end
 
function FStamina_Toggle()
    if FStaminaToggled then
        FStaminaToggled = false
    else
        FStaminaToggled = true
    end
end
concommand.Add( "FanStamina_toggle", FStamina_Toggle )

function FStamina_Regen()
	for k, v in pairs(player.GetAll()) do
		if (v:GetMoveType() ~= MOVETYPE_NOCLIP) and (!v:KeyDown(IN_SPEED)) and (!v:KeyDown(IN_FORWARD)) and (!v:KeyDown(IN_BACK)) and (!v:KeyDown(IN_MOVELEFT)) and (!v:KeyDown(IN_MOVERIGHT)) then
			local Stam = v:GetNWInt("FStamina")
			if v:IsOnGround() and v:WaterLevel() == 0 then
				v:SetNWInt( "FStamina", math.Clamp(Stam+2, 0, 100))
			elseif v:WaterLevel() == 1 then
				v:SetNWInt( "FStamina", math.Clamp(Stam+3, 0, 100))
			end
		end
	end
end
timer.Create("FStamina_Regen", 0.5, 0, FStamina_Regen)


And how I installed it?

Run it shared.

???

Run it in some shared file, either lua/autorun or some gamemode file. Either way, make sure it runs after the gamemode is loaded.

And how do I do to use it?

It will automatically load to the server (after restart) look at the top of your screen.

And where should I put it?

Put that code in /lua/autorun/stamina.lua
Make a file named stamina.lua