All pastes #428891 Raw Edit

Stuff

public lua v1 · immutable
·published 2007-04-07 22:03 UTC
rendered paste body
AddCSLuaFile( "cl_init.lua" )AddCSLuaFile( "shared.lua" )include( 'shared.lua' )ENT.time = 300ENT.text = "This loud speaker has had no text set"function ENT:SpawnFunction( ply, tr )	if ( !tr.Hit ) then return end		local SpawnPos = tr.HitPos + tr.HitNormal * 16		local ent = ents.Create( "sent_loudspeaker" )		ent:SetPos( SpawnPos )        ent:Spawn()        ent:Activate()		return ent	end/*---------------------------------------------------------   Name: Initialize---------------------------------------------------------*/function ENT:Initialize()	self.Entity:SetModel( "models/props_wasteland/speakercluster01a.mdl" )    self.Entity:PhysicsInit(SOLID_VPHYSICS)	self.Entity:SetMoveType(MOVETYPE_VPHYSICS)	self.Entity:SetSolid(SOLID_VPHYSICS)    timer.Simple(self.time, self:Broadcast)	endfunction ENT:OnTakeDamage( dmginfo )	self.Entity:TakePhysicsDamage( dmginfo )	endfunction ENT:Broadcast()    timer.Simple(self.time, self:Broadcast)    local find = ents.FindInSphere(self.Entity:GetPos(), self.radius)    for k,v in pairs(find) do        if v:IsPlayer() then            v:PrintMessage(HUD_PRINTCHAT, self.text)        end    endend