Advertisement
pogh10

Untitled

May 25th, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. -- Start Spawn Functions
  2. function EXPSetVarsOnSpawn(pl)
  3. if pl:GetNWInt("Skill_HP", 0) >= 1 then
  4. pl:SetMaxHealth(100 + MaxHpGain*pl:GetNWInt("Skill_HP"))
  5. pl:SetHealth(pl:GetMaxHealth())
  6. end
  7. if pl:GetNWInt("Skill_ARMOR", 0) >= 1 then
  8. pl:SetArmor(0 + MaxArmorGain*pl:GetNWInt("Skill_ARMOR"))
  9. pl.MaxArmor = (100 + MaxArmorGain*pl:GetNWInt("Skill_ARMOR"))
  10. else
  11. pl.MaxArmor = 100
  12. end
  13. if pl:GetNWInt("Skill_REGEN", 0) >= 1 then
  14. pl.RegTime = (RegTimeVar*pl:GetNWInt("Skill_REGEN"))
  15. else
  16. pl.RegTime = 0
  17. end
  18. if pl:GetNWInt("Skill_ARMREGEN", 0) >= 1 then
  19. pl.RegArmTime = (RegArmTimeVar*pl:GetNWInt("Skill_ARMREGEN"))
  20. else
  21. pl.RegArmTime = 0
  22. end
  23. if pl:GetNWInt("Skill_JUMP", 0) >= 1 then
  24. pl:SetJumpPower(160 + JumpPowerVar*pl:GetNWInt("Skill_JUMP"))
  25. end
  26. if pl:GetNWInt("Skill_RESISTANCE", 0) >= 1 then
  27. pl.Resistance = (1 - ResistanceVar*pl:GetNWInt("Skill_RESIST"))
  28. else
  29. pl.Resistance = 1
  30. end
  31.  
  32. if pl:GetNWInt("Skill_SPEED", 0) >= 1 then
  33. pl.Resistance = (1 - ResistanceVar*pl:GetNWInt("Skill_SPEED"))
  34. pl:SetWalkSpeed(150 + pl:GetNWInt("Skill_SPEED") * 5 )
  35. pl:SetRunSpeed(250 + pl:GetNWInt("Skill_SPEED") * 5 )
  36. end
  37. end
  38. hook.Add( "PlayerLoadout", "Set Vars On Spawn", EXPSetVarsOnSpawn )
  39. -- End Spawn Functions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement