Advertisement
Guest User

Crit example

a guest
Aug 12th, 2018
1,022
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.29 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment
Advertisement