[code]
ENT.Type = "anim"
ENT.Base = "base_anim"
ENT.PrintName = "Singing Brick"
ENT.RenderGroup = RENDERGROUP_TRANSLUCENT
function ENT:Initialize()
if ( SERVER ) then
self.Entity:SetModel( "models/props_junk/CinderBlock01a.mdl" )
self.Entity:PhysicsInit( SOLID_VPHYSICS )
end
end
function ENT:Use( activator, caller )
if ( activator:IsPlayer()) then
self:EmitSound("team fortress 2\tf\sound\ui\tv_tune3.mp3", 500, 200)
end
end
function ENT:SpawnFunction( ply, tr )
if ( !tr.Hit ) then return end
local SpawnPos = tr.HitPos + tr.HitNormal
local ent = ents.Create( ClassName )
ent:SetPos( SpawnPos )
ent:Spawn()
ent:Activate()
return ent
[/code]
OK so i have what i want so far but what i have been trying hasn't worked. I want this entity to do just its name, sing.
in my entity use function I tried making it emit a sound i provided in the parameters which is a tf2 show tune.
But when I click e on it i get 4 stack overflow errors and it brings me immediately back to the GMod start menu. Any help would be appreciated.
[editline]5th February 2011[/editline]
[b]
Fixed - unnecessary checks and so on.
/thread
[/b]
Sorry, you need to Log In to post a reply to this thread.