Guest User

Untitled

a guest
Nov 26th, 2021
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1.         if inst.components.combat then
  2.             if self.defaultattackperiod == nil then
  3.                 if inst.components.combat.min_attack_period ~= nil then
  4.                     self.defaultattackperiod = inst.components.combat.min_attack_period
  5.                 else
  6.                     print("Time Control [API]: Attack Perioid adjustment failed, entity missing min_attack_period")
  7.                 end
  8.             end
  9.            
  10.             local attackperiod = (self.defaultattackperiod / speed) or nil
  11.            
  12.             if speed == nil or speed == "reset" or speed == 1 then
  13.                 self.inst.components.combat:SetAttackPeriod(self.defaultattackperiod)
  14.             elseif attackperiod ~= nil then
  15.                 self.inst.components.combat:SetAttackPeriod(attackperiod)
  16.             end
  17.         end
  18.  
  19.     end
Advertisement
Add Comment
Please, Sign In to add comment