XaskeL

Untitled

Jul 24th, 2019
129
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local middleclass = loadstring(exports.shared:modules('shared.middleclass'))()
  2.  
  3. local NPCBase = middleclass.class('NPCBase')
  4. NPCBase.alive = {}
  5.  
  6. function NPCBase:initialize(params)
  7.     self.params = params;
  8. end
  9.  
  10. function NPCBase:setHealth(n)
  11.     self.params.health = n;
  12. end
  13.  
  14. function NPCBase:getHealth()
  15.     print(self.params.health)
  16.     return self.params.health
  17. end
  18.  
  19. -----------------------------------------------------------------------------------------------------------
  20.  
  21. local bot1 = NPCBase:new({id=1,type="zombie",health=12000,walkStyle="sprint"})
  22. -- print(bot1:getHealth())
  23.  
  24. -----------------------------------------------------------------------------------------------------------
  25.  
  26. local Animals = middleclass.class('Animals', NPCBase)
  27. local bot2 = Animals:new({id=2,type="animal",health=6000,walkStyle="sprint"})
  28.  
  29. setTimer(Animals.getHealth, 50, 1, bot2)
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×