Advertisement
Exho

Untitled

Aug 13th, 2014
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. AddCSLuaFile()
  2.  
  3. --[[
  4. local RandomStats = {}
  5.  
  6. local function RandomizeStats()
  7. RandomStats["weapon_ttt_m16"] = {dmg = math.random(16, 28), recoil = math.random(1.3,1.8) }
  8. RandomStats["weapon_ttt_glock"] = {dmg = math.random(8, 16), recoil = math.random(0.7,1.2) }
  9. RandomStats["weapon_zm_mac10"] = {dmg = math.random(8, 16), recoil = math.random(0.7,1.2) }
  10.  
  11. end
  12.  
  13. local function WeaponStatChanger()
  14. for k, v in pairs( ents.GetAll() ) do
  15. RandomizeStats()
  16. print("ENTITIES -- "..v:GetClass())
  17. for key, tableClass in pairs ( RandomStats ) do
  18. local class = v:GetClass()
  19. if class == tableClass then
  20. local wep = v
  21. print("Gun match - " ..class)
  22. print("Old Damage " .. wep.Primary.Damage)
  23. wep.Primary.Damage = RandomStats[class][1]
  24. wep.Primary.Recoil = RandomStats[class][2]
  25. print("New damage " .. wep.Primary.Damage)
  26. print("New values set")
  27. end
  28. end
  29. end
  30. end
  31. hook.Add( "InitPostEntity", "Thing", WeaponStatChanger )
  32. ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement