Hey, sorry for all the thread creation but it seems the things I want to know are things that no one else wants to know o_O
I wanna make an entity that behaves somewhat like a gib. Once created, it has physics but can't be physgun'd and it disappears after like 30 seconds.
I would like it to fade out if possible, but disappearing is fine if fading is too complicated. Anyone know where to start?
[editline]04:55PM[/editline]
Really? Nobody knows?
Make it an effect
[lua]
function EFFECT:Init(data)
self:SetModel("models/gibs/hgibs.mdl") --???
self:SetPos(data:GetOrigin())
self:PhysicsInit(SOLID_VPHYSICS)
self:SetCollisionBounds(self:GetRenderBounds())
self.die = CurTime()+40 --You can change the time here
end
function EFFECT:Think()
return self.die > CurTime()
end
function EFFECT:Render()
self:DrawModel()
end
[/lua]
Thanks, I'll try that.
Sorry, you need to Log In to post a reply to this thread.