Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddCSLuaFile( "cl_init.lua" )
- AddCSLuaFile( "shared.lua" )
- include( 'shared.lua' )
- function ENT:Initialize()
- self.BaseClass.Initialize(self)
- timer.Simple(0.1,function() self:CalcVars(self:GetTable().Founder) end)
- end
- function ENT:CalcVars(ply)
- if not (ply.icelasermod > 1) then self:Remove() return end
- /*if (ply.UserGroup == "ice") then
- self.LaserCycle = math.floor(self.LaserCycle * 0.75)
- end*/
- end
- function ENT:SpawnFunction( ply, tr )
- if ( !tr.Hit ) then return end
- local SpawnPos = tr.HitPos + tr.HitNormal * 100
- local ent = ents.Create( "ice_mining_laser_3" )
- ent:SetPos( SpawnPos )
- ent:Spawn()
- ent:Activate()
- ent.Owner = ply
- return ent
- end
- function ENT:Think()
- self.BaseClass.BaseClass.Think(self)
- self.percent = math.Round((self.pulls/self.LaserCycle)*100)
- self:SetOverlayText(self.PrintName.."\n".."Cycle: "..self.percent.."%")
- Wire_TriggerOutput(self.Entity,"Cycle %",self.percent)
- if self.InputActive and self.nextpull < CurTime() then
- self:Mine()
- self:Mine()
- elseif self.pulls < self.LaserCycle and self.pulls > 0 then
- if self.nextpull < CurTime() then
- self:Mine()
- self:Mine()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement