Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --include("classdata.lua")
- --AddCSLuaFile( "autorun/client/cl_classmod.lua" )
- CreateConVar("bur_class_walkspeed", "200", FCVAR_REPLICATED + FCVAR_NOTIFY + FCVAR_ARCHIVE , "Changes the walkspeed. Default walkspeed is 250." )
- CreateConVar("bur_class_runspeed", "400", FCVAR_REPLICATED + FCVAR_NOTIFY + FCVAR_ARCHIVE , "Changes the runspeed. Default walkspeed is 500." )
- CreateConVar("bur_class_jumppower", "200", FCVAR_REPLICATED + FCVAR_NOTIFY + FCVAR_ARCHIVE , "Changes the jumping power. Default jumppower is 200." )
- function ChangeClass( ply, cmd, args )
- local num = tonumber(args[1])
- if type(num) ~= "number" then return error("ERROR: CHANGECLASS NEEDS TO BE A NUMBER") end
- if num <= table.Count(Class) then
- ply.ClassNumberTo = num
- ply.ClassName = Class[num]["name"]
- ply.ClassDescription = Class[num]["description"]
- ply:ChatPrint("Your class will change to "..Class[num]["name"]..".")
- --ply.ClassChanged = true
- ply:Spawn()
- else
- error("ERROR: CHANGECLASS DOESN'T EXIST")
- return end
- end
- concommand.Add("changeclass", ChangeClass)
- function FirstClassSpawn( ply )
- ply.NextSwapTime = 0
- ply.NextTick = 0
- ply.ClassNumber = 1
- ply.ClassNumberTo = 1
- ply:SetNWInt("classnum",ply.ClassNumber)
- ply:SetNWInt("stamina",Class[ply.ClassNumber]["stamina"])
- ply.Energy = Class[ply.ClassNumber]["stamina"]
- end
- hook.Add( "PlayerInitialSpawn", "Initialize Class", FirstClassSpawn )
- function PlayerClassSpawn(ply)
- ply.NextTick = 0
- if ply.ClassNumber == nil then
- ply.ClassNumber = 1
- end
- if ply.ClassNumberTo == nil then
- ply.ClassNumberTo = 1
- end
- ply.ClassNumber = ply.ClassNumberTo
- ply.Energy = Class[ply.ClassNumber]["stamina"]
- ply:SetNWInt("stamina",Class[ply.ClassNumber]["stamina"])
- ply:SetNWInt("classnum",ply.ClassNumber)
- CheckPerks(ply)
- local Players = player.GetAll()
- print("-----------------------------------")
- print("DAMAGE DEALT TO "..string.upper(ply:Nick()) .. ":")
- for i=1, table.Count(Players) do
- if ply:GetNWInt(i,0) > 0 then
- print(Entity(i):Nick() .. ": " .. ply:GetNWInt(i,0))
- ply:SetNWInt(i,0)
- end
- end
- print("-----------------------------------")
- timer.Simple(0.01, function()
- CheckPerks(ply)
- ply:SetNWInt("classnum",ply.ClassNumber)
- ply:SetHealth(Class[ply.ClassNumber]["health"])
- ply:SetArmor(Class[ply.ClassNumber]["armor"])
- ply:SetMaxHealth(Class[ply.ClassNumber]["health"])
- ply:SetWalkSpeed(Class[ply.ClassNumber]["walkspeedmul"] * GetConVar("bur_class_walkspeed"):GetInt() )
- ply:SetRunSpeed(Class[ply.ClassNumber]["runspeedmul"] * GetConVar("bur_class_runspeed"):GetInt() )
- ply:SetJumpPower(Class[ply.ClassNumber]["jumpmul"] * GetConVar("bur_class_jumppower"):GetInt() )
- ply:SetCrouchedWalkSpeed(Class[ply.ClassNumber]["crouchmul"]*0.5)
- end)
- end
- hook.Add("PlayerSpawn", "Player Class Spawn", PlayerClassSpawn)
- function ScaleClassDamage( ply, hitgroup, dmginfo )
- local DamageScale = 1
- if dmginfo:GetAttacker():IsPlayer() and dmginfo:GetAttacker() ~= ply then
- if TableSearcher(ply.ClassNumber,"Evasion") == true && math.random(0,100) >= 90 then
- DamageScale = 0
- ply:EmitSound("ui/freeze_cam.wav",100,math.Rand(90,110))
- dmginfo:ScaleDamage(0)
- return end
- if TableSearcher(dmginfo:GetAttacker().ClassNumber,"Splash") == true then
- local result = ents.FindInSphere(ply:GetPos(),1000)
- local resultCount = table.Count(result)
- print(result)
- DamageScale = 0.9
- for i=1, resultCount do
- if result[i]:IsPlayer() == true then
- print(result[i]:Nick())
- if result[i] ~= ply and result[i] ~= dmginfo:GetAttacker() then
- if result[i]:Team() == dmginfo:GetAttacker():Team() and ply:Team() == 1001 then
- damage = dmginfo:GetBaseDamage()*0.1
- result[i]:TakeDamage(damage, dmginfo:GetAttacker(), dmginfo:GetAttacker():GetActiveWeapon())
- elseif result[i]:Team() ~= dmginfo:GetAttacker():Team() and ply:Team() ~= 1001 then
- damage = dmginfo:GetBaseDamage()*0.1
- result[i]:TakeDamage(damage, dmginfo:GetAttacker(), dmginfo:GetAttacker():GetActiveWeapon())
- end
- end
- end
- end
- end
- if TableSearcher(dmginfo:GetAttacker().ClassNumber,"Stunner") == true && math.Rand(0,100) >= 100 - (dmginfo:GetBaseDamage()/2) then
- DamageScale = 2
- ply:EmitSound("player/crit_received1.wav",100,100)
- dmginfo:GetAttacker():EmitSound("player/crit_hit.wav",100,100)
- if ply:IsFrozen() == false then
- ply:Freeze(true)
- timer.Simple(0.5,function()
- ply:Freeze( false )
- end)
- end
- end
- if TableSearcher(ply.ClassNumber,"Swap") == true then
- --print("Swap")
- if ply:Health() < 50 then
- --print("Swaping")
- if ply:Alive() == false then return end
- if ply.NextSwapTime <= CurTime() then
- ply.NextSwapTime = CurTime() + 60
- local Players = player.GetAll()
- local rand = math.random(1,table.Count(Players))
- local toSwap = Players[rand]
- if toSwap == ply then
- if rand+1<= table.Count(Players) then
- toSwap = Players[rand+1]
- --print("debug" ..debugnum)
- debugnum = rand+1
- elseif rand-1 >= 1 then
- debugnum = rand-1
- --print("debug" .. debugnum)
- toSwap = Players[rand-1]
- else
- print("weird")
- end
- end
- local pos1 = ply:GetPos()
- local pos2 = toSwap:GetPos()
- ply:SetPos(pos2)
- toSwap:SetPos(pos1)
- ply:EmitSound("ambient/machines/teleport4.wav",100,100)
- toSwap:EmitSound("ambient/machines/teleport4.wav",100,100)
- end
- end
- end
- if TableSearcher(dmginfo:GetAttacker().ClassNumber,"LifeSteal") == true then
- if dmginfo:GetAttacker():Health() + math.max(0,dmginfo:GetDamage()*0.1) >= 200 then
- dmginfo:GetAttacker():SetHealth(200)
- else
- dmginfo:GetAttacker():SetHealth(dmginfo:GetAttacker():Health() + math.max(0,dmginfo:GetDamage()*0.1) )
- end
- end
- if TableSearcher(dmginfo:GetAttacker().ClassNumber,"Survivor") == true then
- DamageScale = 1 + math.abs(dmginfo:GetAttacker():Health()-dmginfo:GetAttacker():GetMaxHealth())/1000
- end
- if TableSearcher(dmginfo:GetAttacker().ClassNumber,"ArmorSteal") == true then
- if dmginfo:GetDamage()*0.15 < ply:Armor() then
- if dmginfo:GetAttacker():Armor() + dmginfo:GetDamage()*0.15 >= 200 then
- dmginfo:GetAttacker():SetArmor(200)
- else
- dmginfo:GetAttacker():SetArmor(dmginfo:GetAttacker():Armor() + dmginfo:GetDamage()*0.15 )
- end
- end
- end
- if TableSearcher(dmginfo:GetAttacker().ClassNumber,"SoulAbsorb") == true then
- dmginfo:GetAttacker().SoulCount = dmginfo:GetAttacker().SoulCount + math.floor(dmginfo:GetDamage())
- dmginfo:GetAttacker().SoulsDelivered = dmginfo:GetAttacker().SoulCount + math.floor(dmginfo:GetDamage())
- end
- if TableSearcher(ply.ClassNumber,"Helmet") == true then
- if hitgroup == HITGROUP_HEAD then
- ply:EmitSound("player/kevlar"..math.random(1,5)".wav",100,100)
- DamageScale = DamageScale*0.9
- else
- DamageScale = DamageScale*1
- end
- end
- if TableSearcher(ply.ClassNumber,"Kevlar") == true then
- if hitgroup == HITGROUP_HEAD then
- DamageScale = DamageScale*1
- else
- DamageScale = DamageScale*0.85
- ply:EmitSound("player/kevlar"..math.random(1,5)".wav",100,100)
- end
- end
- if TableSearcher(ply.ClassNumber,"Shield") == true and math.random(0,100) >= 40 then
- if ply.ItemDurability > 0 then
- ply.ItemDurablity = ply.ItemDurability - 1
- DamageBlock = math.Rand(1,5*(ply.ItemDurability/100))
- dmginfo:SubtractDamage(DamageBlock)
- ply:EmitSound("player/bhit_helmet-1.wav",100,math.Rand(90,110))
- end
- end
- if TableSearcher(dmginfo:GetAttacker().ClassNumber,"AP") == true then
- if ply:Armor() > 0 then
- DamageScale = DamageScale + (ply:Armor()*0.005) - 0.25
- ply:EmitSound("mvm/physics/robo_impact_bullet0"..math.random(1,4)..".wav",100,math.Rand(90,110))
- end
- end
- if TableSearcher(ply.ClassNumber,"BrainDamage") == true then
- if hitgroup == HITGROUP_HEAD then
- DamageScale = DamageScale*3
- ply:EmitSound("player/headshot"..math.random(1,2)..".wav",100,100)
- else
- DamageScale = DamageScale*0.85
- end
- end
- if TableSearcher(dmginfo:GetAttacker().ClassNumber,"HeadshotHunter") == true then
- if hitgroup == HITGROUP_HEAD then
- DamageScale = DamageScale*2
- ply:EmitSound("player/headshot"..math.random(1,2)..".wav",100,100)
- else
- DamageScale = DamageScale*0.5
- end
- end
- if TableSearcher(dmginfo:GetAttacker().ClassNumber,"ReflectDamage") == true then
- DamageScale = DamageScale*0.75
- end
- if TableSearcher(ply.ClassNumber,"ReflectDamage") == true then
- DamageScale = DamageScale*0.9
- if TableSearcher(dmginfo:GetAttacker().ClassNumber,"ReflectDamage") == false then
- dmginfo:GetAttacker():TakeDamage(dmginfo:GetBaseDamage()*DamageScale*0.1, ply, dmginfo:GetAttacker():GetActiveWeapon())
- end
- end
- if TableSearcher(ply.ClassNumber,"FlakJacketMajor") == true then
- if dmginfo:GetDamageType() == DMG_BLAST then
- DamageScale = DamageScale*0.75
- if math.random(1,100) >= 80 and dmginfo:GetBaseDamage() > 30 then
- dmginfo:GetAttacker():TakeDamage(dmginfo:GetBaseDamage() - 30, ply, dmginfo:GetAttacker():GetActiveWeapon())
- end
- end
- end
- if TableSearcher(ply.ClassNumber,"FlakJacketMinor") == true then
- if dmginfo:GetDamageType() == DMG_BLAST then
- DamageScale = DamageScale*0.85
- end
- end
- if TableSearcher(ply.ClassNumber,"Reversal") == true and math.random(0,100) >= 93 then
- ply:EmitSound("items/smallmedkit1.wav",100,100)
- if (ply:Health() + DamageScale * dmginfo:GetBaseDamage()) >= ply:GetMaxHealth() then
- ply:SetHealth(ply:GetMaxHealth())
- else
- ply:SetHealth(ply:Health() + DamageScale * dmginfo:GetBaseDamage() )
- end
- DamageScale = DamageScale*0
- end
- dmginfo:ScaleDamage(DamageScale)
- if hitgroup == HITGROUP_HEAD then
- HiddenScale = 2
- else
- HiddenScale = 1
- end
- ply:SetNWInt(dmginfo:GetAttacker():EntIndex(), ply:GetNWInt(dmginfo:GetAttacker():EntIndex()) + (HiddenScale * DamageScale * dmginfo:GetBaseDamage()))
- end
- --print(dmginfo:GetInflictor():GetClass())
- --print(dmginfo:GetAttacker():GetClass())
- end
- hook.Add("ScalePlayerDamage","Scale Class Damage",ScaleClassDamage)
- function ScaleFallDamage(ply, speed)
- --print("you fell gg")
- --print(Class[ply.ClassNumber]["fallmul"])
- if GetConVarNumber("mp_falldamage") == 1 then
- speed = speed - 580
- local punch = math.max(0,speed/10) * Class[ply.ClassNumber]["fallmul"]
- --print(punch)
- ply:ViewPunch(Angle(punch,0,0))
- return speed * (100/(1024-580)) * Class[ply.ClassNumber]["fallmul"]
- end
- return 10 * Class[ply.ClassNumber]["fallmul"]
- end
- hook.Add("GetFallDamage","ScaleFallDamage",ScaleFallDamage)
- function CheckPerks(ply)
- if TableSearcher(ply.ClassNumber,"Shield") == true then
- ply.ItemDurability = 100
- end
- if TableSearcher(ply.ClassNumber,"LifeRegen") == true then
- timer.Create( "LifeGainPerkTick" .. ply:EntIndex(), 1, 0, function()
- if ply:IsValid() == false then timer.Destroy("LifeGainPerkTick" .. ply:EntIndex()) return end
- if ply:Alive() == false then timer.Destroy("LifeGainPerkTick" .. ply:EntIndex()) return end
- if TableSearcher(ply.ClassNumber,"LifeRegen") == false then timer.Destroy("LifeGainPerkTick" .. ply:EntIndex()) return end
- if ply:Health() >= ply:GetMaxHealth() then return end
- ply:SetHealth(ply:Health() + 1)
- end)
- end
- if TableSearcher(ply.ClassNumber,"ArcLight") == true then
- timer.Create( "ArcLightTick" .. ply:EntIndex(), 0.5, 0, function()
- if ply:IsValid() == false then timer.Destroy("ArcLightTick" .. ply:EntIndex()) return end
- if ply:Alive() == false then timer.Destroy("ArcLightTick" .. ply:EntIndex()) return end
- if TableSearcher(ply.ClassNumber,"ArcLight") == false then timer.Destroy("ArcLightTick" .. ply:EntIndex()) return end
- local result = ents.FindInSphere(ply:GetPos(),300)
- local resultCount = table.Count(result)
- for i=1, resultCount do
- if result[i]:IsPlayer() == true then
- if result[i] ~= ply then
- if result[i]:Team() == ply:Team() and ply:Team() ~= 1001 then return end
- local damage = (300 - ply:GetPos():Distance(result[i]:GetPos()))/200
- result[i]:TakeDamage(damage, ply, ply)
- end
- end
- end
- end)
- end
- if TableSearcher(ply.ClassNumber,"Medic") == true then
- timer.Create( "MedicAura" .. ply:EntIndex(), 1, 0, function()
- if ply:IsValid() == false then timer.Destroy("MedicAura" .. ply:EntIndex()) return end
- if ply:Alive() == false then timer.Destroy("MedicAura" .. ply:EntIndex()) return end
- if TableSearcher(ply.ClassNumber,"Medic") == false then timer.Destroy("MedicAura" .. ply:EntIndex()) return end
- local Team = team.GetPlayers(ply:Team())
- local TeamCount = table.Count(Team)
- for i=1, TeamCount do
- if Team[i]:Alive() == false then return end
- if Team[i]:Team() == 1001 then return end
- if Team[i]:Health() < Team[i]:GetMaxHealth() then
- Team[i]:SetHealth(Team[i]:Health() + 1)
- end
- end
- end)
- end
- if TableSearcher(ply.ClassNumber,"LifeSteal") == true then
- timer.Create( "HealthDecay" .. ply:EntIndex(), 3, 0, function()
- if ply:IsValid() == false then timer.Destroy("HealthDecay" .. ply:EntIndex()) return end
- if ply:Alive() == false then timer.Destroy("HealthDecay" .. ply:EntIndex()) return end
- if TableSearcher(ply.ClassNumber,"LifeSteal") == false then timer.Destroy("HealthDecay" .. ply:EntIndex()) return end
- if ply:Health() <= ply:GetMaxHealth() then return end
- ply:SetHealth(ply:Health() - 1)
- end)
- end
- if TableSearcher(ply.ClassNumber,"Snackbar") == true then
- timer.Create( "ExplodeCheck" .. ply:EntIndex(), 0.1, 0, function()
- if ply:IsValid() == false then timer.Destroy("ExplodeCheck" .. ply:EntIndex()) return end
- if TableSearcher(ply.ClassNumber,"Snackbar") == false then timer.Destroy("ExplodeCheck" .. ply:EntIndex()) return end
- if ply:Alive() == false then
- timer.Destroy("ExplodeCheck" .. ply:EntIndex())
- local effectdata = EffectData()
- effectdata:SetStart( ply:GetPos() )
- effectdata:SetOrigin( ply:GetPos() )
- effectdata:SetScale( 1 )
- util.Effect( "Explosion", effectdata )
- util.BlastDamage(ply, ply, ply:GetPos(), 250, 100)
- util.Decal("Scorch", ply:GetPos(), ply:GetPos())
- if table.Count(ents.FindInSphere(ply:GetPos(),250)) > 0 then
- for k,v in pairs(ents.FindInSphere(ply:GetPos(),250)) do
- if v:GetClass() == "prop_physics" then
- if math.Rand(0,100) >= 70 then
- v:Ignite(250/20 - v:GetPos():Distance( ply:GetPos() )/20,0)
- end
- timer.Simple(0,function()
- if v:IsValid() == false then return end
- constraint.RemoveAll(v)
- v:GetPhysicsObject():EnableMotion(true)
- v:GetPhysicsObject():Wake()
- end)
- end
- if v:GetClass() == "prop_door_rotating" then
- v:Fire( "Unlock", 0 )
- v:Fire( "Open", 0.1 )
- end
- end
- end
- end
- end)
- end
- if TableSearcher(ply.ClassNumber,"Cloak") == true then
- ply.ArmorDrainCount = 0
- timer.Create( "CloakCheckTick" .. ply:EntIndex(), 0.1, 0, function()
- if ply:IsValid() == false then timer.Destroy("CloakCheckTick" .. ply:EntIndex()) return end
- if ply:Alive() == false then timer.Destroy("CloakCheckTick" .. ply:EntIndex()) return end
- if TableSearcher(ply.ClassNumber,"Cloak") == false then timer.Destroy("CloakCheckTick" .. ply:EntIndex()) return end
- if ply:Armor() > 0 then
- -- ply:SetColor(255,255,255,255)
- ply.MoveSpeed = ply:GetVelocity():Length()
- if ply.MoveSpeed < 10 then
- ply:SetMaterial("models/effects/vol_light001")
- --ply:GetActiveWeapon():SetMaterial("models/effects/vol_light001")
- elseif ply.MoveSpeed < 70 then
- ply:SetMaterial("models/shadertest/predator")
- --ply:GetActiveWeapon():SetMaterial("models/shadertest/predator")
- else
- ply:SetMaterial("")
- -- ply:GetActiveWeapon():SetMaterial("")
- end
- ply.ArmorDrainCount = ply.ArmorDrainCount + 1
- if ply.ArmorDrainCount >= 30 then
- ply.ArmorDrainCount = 0
- ply:SetArmor(ply:Armor() - 1)
- end
- else
- ply:SetMaterial("")
- end
- end)
- end
- if TableSearcher(ply.ClassNumber,"Necro") then
- timer.Create( "NecroTick" .. ply:EntIndex(), 1, 0, function()
- if ply:IsValid() == false then timer.Destroy("NecroTick" .. ply:EntIndex()) return end
- if ply:Alive() == false then timer.Destroy("NecroTick" .. ply:EntIndex()) return end
- if TableSearcher(ply.ClassNumber,"Necro") == false then timer.Destroy("NecroTick" .. ply:EntIndex()) return end
- ply:SetMaxHealth(1)
- end)
- end
- if TableSearcher(ply.ClassNumber,"SoulAbsorb") then
- ply.SoulsDelivered = 100
- ply.SoulCount = 0
- ply.CountTick = 0
- ply.SmallSoulsWarning = true
- ply.ZeroSoulsWarning = true
- ply.PissedOffDemons = false
- timer.Create( "SoulRegen" .. ply:EntIndex(), 1, 0, function()
- if ply:IsValid() == false then timer.Destroy("SoulRegen" .. ply:EntIndex()) return end
- if ply:Alive() == false then timer.Destroy("SoulRegen" .. ply:EntIndex()) return end
- if TableSearcher(ply.ClassNumber,"SoulAbsorb") == false then timer.Destroy("SoulRegen" .. ply:EntIndex()) return end
- ply.SoulsDelivered = ply.SoulsDelivered - 1
- --print(ply.SoulsDelivered)
- if ply.SoulCount > 0 and ply:Armor() < ply.SoulCount*0.1 then
- ply:SetArmor(ply:Armor() + 1)
- end
- if ply.SoulsDelivered <= 20 and ply.SmallSoulsWarning == true then
- ply.SmallSoulsWarning = false
- ply:ChatPrint("The keepers of oblivion are getting angry for your lack of souls.")
- ply:EmitSound("npc/stalker/breathing3.wav",100,50)
- end
- if ply.SoulsDelivered < 0 and ply.ZeroSoulsWarning == true and ply.PissedOffDemons == false then
- ply.ZeroSoulsWarning = false
- ply.PissedOffDemons = true
- ply:ChatPrint("The keepers of oblivion is absorbing your very soul for your lack of commitment.")
- ply:ConCommand("pp_mat_overlay effects/invuln_overlay_red ")
- ply:ConCommand("pp_mat_overlay_refractamount 1")
- end
- if ply.SoulsDelivered > 100 and ply.PissedOffDemons == true then
- ply.PissedOffDemons = false
- ply:ChatPrint("The keepers of oblivion have been appeased, but they have left a mark on your max health.")
- ply.SmallSoulsWarning = true
- ply.ZeroSoulsWarning = true
- ply:ConCommand("pp_mat_overlay \"\" ")
- ply:ConCommand("pp_mat_overlay_refractamount 0")
- end
- if ply.PissedOffDemons == true then
- ply.CountTick = ply.CountTick + 1
- else
- ply.CountTick = 0
- end
- if ply.CountTick == 3 then
- ply.CountTick = 0
- if ply:Health() > 7 then
- ply:SetHealth(ply:Health() - 7)
- ply:SetMaxHealth(ply:GetMaxHealth() - 5)
- ply:EmitSound("npc/headcrab_poison/ph_hiss1.wav", 100, 50)
- ply:ViewPunch(Angle(math.random(-5,5),math.random(-5,5),math.random(-5,5)))
- else
- ply:Kill()
- ply:EmitSound("npc/vort/vort_dispell.wav", 100, 50)
- ply:ConCommand("pp_mat_overlay \"\" ")
- ply:ConCommand("pp_mat_overlay_refractamount 0")
- end
- end
- end)
- end
- end
- function TableSearcher(num,tofind)
- local found = false
- if Class[num] == nil then error("RETURNED NIL") return false end
- if Class[num]["perks"][1] == "none" then return false end
- for i=1, table.Count(Class[num]["perks"]) do
- --print(Class[num]["perks"][i])
- if table.HasValue(Class[num]["perks"],tofind) then
- found = true
- end
- end
- return found end
- function SVSprintThink()
- local PlayerTable = player.GetAll()
- for i=1, table.Count(player.GetAll()) do
- local ply = PlayerTable[i]
- --print(ply:GetVelocity():Length())
- ply.Stamina = Class[ply.ClassNumber]["stamina"]
- local WalkSpeed = Class[ply.ClassNumber]["walkspeedmul"] * GetConVar("bur_class_walkspeed"):GetInt()
- local RunSpeed = Class[ply.ClassNumber]["runspeedmul"] * GetConVar("bur_class_runspeed"):GetInt()
- if ply:KeyDown(IN_SPEED) then
- if ply.Energy >= 0.2 then
- if ply.NextTick < CurTime() then
- ply.NextTick = CurTime() + 0.2
- ply.Energy = ply.Energy - 0.2
- ply:SetRunSpeed(RunSpeed)
- end
- else
- ply:SetRunSpeed(WalkSpeed)
- end
- else
- if ply.Energy < ply.Stamina then
- if ply.NextTick < CurTime() then
- ply.NextTick = CurTime() + 0.25
- ply.Energy = ply.Energy + ply.Stamina*0.01
- end
- else
- ply.Energy = ply.Stamina
- end
- end
- ply:SetNWInt("Energy",ply.Energy)
- end
- end
- hook.Add("Think", "Serverside Sprint Think", SVSprintThink)
- function SelectClassMenu( ply )
- --ply:ConCommand("selectweapon")
- ply:ConCommand("selectclass")
- end
- function SelectWeaponMenu( ply )
- ply:ConCommand("selectweapon")
- --ply:ConCommand("selectclass")
- end
- hook.Add("ShowSpare1", "Select Class Menu", SelectClassMenu)
- hook.Add("ShowSpare2", "Select Weapon Menu", SelectWeaponMenu)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement