Advertisement
Guest User

Crit example

a guest
Aug 12th, 2018
768
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Item.setRandomCrit(self)
  2.     self:setAbility(ITEM_ABILITY_CRITICALHITCHANCE, math.random(1, 100))
  3.     self:setAbility(ITEM_ABILITY_CRITICALHITAMOUNT, math.random(1, 100))
  4. end
  5.  
  6. local item = player:getSlotItem(CONST_SLOT_LEFT)
  7. item:setRandomCrit() -- rolls a random crit chance + damage modifier
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement