Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ENT:Think()
- if monitor.on == 0 then return end
- local time = os.time()
- -- print( "time = " .. time ) print( "last = " .. last )
- if last > time - 1 then return end
- -- print( "Ran @@@@" )
- last = time
- local rate = 0
- local total = 0
- local minernumber = 0
- local ang = self:GetAngles()
- -- print("")
- -- print(ang[1])
- -- print(ang[2])
- -- print(ang[3])
- -- if ang[1] > 10
- if ang[1] < 10 and ang[1] > -10 then
- if ang[3] < 10 and ang[3] > -10 then
- for _, ent in pairs( ents.FindInSphere( self:GetPos(), 100 ) ) do
- if ent:GetClass() == 'btc_miner_crappy' then
- minernumber = minernumber + 1
- end
- end
- if minernumber > 0 then
- rate = math.Round( math.sqrt(0.1 * minernumber ) * (2 * minernumber ), 3) / 10
- monitor.total = math.Round( ( rate + monitor.total ), 5 )
- net.Start( "BTC_Miners" )
- net.WriteEntity(self)
- net.WriteString( minernumber )
- net.WriteString( rate )
- net.WriteString( monitor.total )
- net.WriteBool( true )
- net.WriteTable( BTC_IDs )
- net.Broadcast()
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement