Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. ENT.lootList = {}
  2. ENT.lootList["Złom"] = {5, 100}
  3. ENT.lootList["Złom elektroniczny"] = {5,100}
  4. ENT.lootList["Żelazko"] = {5,75}
  5. ENT.lootList["Wiatrak biurowy"] = {5,25}
  6. ENT.lootList["Uszkodzona krótkofalówka"] = {5,25}
  7. ENT.lootList["Wiatrak biurowy"] = {5,25}
  8.  
  9. local drops = self.lootList
  10. local loot = {}
  11.  
  12. for v, k in pairs(drops) do
  13. local random = math.Rand(0, 100)
  14. if k[2] >= random then
  15. loot[v] = k
  16. end
  17. end
  18.  
  19.  
  20. while table.Count(loot) > 3 do
  21. for v, k in pairs(loot) do
  22. random = math.Rand(0, 100)
  23. if k[2] <= random then
  24. table.RemoveByValue( loot, v )
  25. end
  26. end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement