Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. AddCSLuaFile( "cl_init.lua" )
  2. AddCSLuaFile( "shared.lua" )
  3. include( 'shared.lua' )
  4.  
  5. function ENT:Initialize()
  6. self.BaseClass.Initialize(self)
  7. timer.Simple(0.1,function() self:CalcVars(self:GetTable().Founder) end)
  8. end
  9.  
  10. function ENT:CalcVars(ply)
  11. if not (ply.icelasermod > 1) then self:Remove() return end
  12. /*if (ply.UserGroup == "ice") then
  13. self.LaserCycle = math.floor(self.LaserCycle * 0.75)
  14. end*/
  15. end
  16.  
  17. function ENT:SpawnFunction( ply, tr )
  18.  
  19. if ( !tr.Hit ) then return end
  20.  
  21. local SpawnPos = tr.HitPos + tr.HitNormal * 100
  22.  
  23. local ent = ents.Create( "ice_mining_laser_3" )
  24. ent:SetPos( SpawnPos )
  25. ent:Spawn()
  26. ent:Activate()
  27. ent.Owner = ply
  28. return ent
  29. end
  30.  
  31. function ENT:Think()
  32. self.BaseClass.BaseClass.Think(self)
  33.  
  34. self.percent = math.Round((self.pulls/self.LaserCycle)*100)
  35. self:SetOverlayText(self.PrintName.."\n".."Cycle: "..self.percent.."%")
  36.  
  37. Wire_TriggerOutput(self.Entity,"Cycle %",self.percent)
  38.  
  39. if self.InputActive and self.nextpull < CurTime() then
  40. self:Mine()
  41. self:Mine()
  42. elseif self.pulls < self.LaserCycle and self.pulls > 0 then
  43. if self.nextpull < CurTime() then
  44. self:Mine()
  45. self:Mine()
  46. end
  47. end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement