Hello all !
I have my code who isn't working but the code is well coded
what its the problem ?
Pos and NPC are ok
Material Exist
Folder of effect exist
but no effect showing on game but all other effect i have work
why this one not ?
part of code shared of NPC
[lua]
local edata = EffectData()
edata:SetOrigin( self:EyePos() + (self:GetUp() * 24))
edata:SetEntity( self )
util.Effect("selleffect", edata, true, true )
[/lua]
whole code from init.lua from folder (selleffect) in entities/effects/
[lua]
EFFECT.Mat = Material("gaming52/light/sell")
function EFFECT:Init( data )
self.Pos = data:GetOrigin()
self.NPC = data:GetEntity()
end
function EFFECT:Think( )
return true
end
function EFFECT:Render( )
render.SetMaterial( self.Mat )
local sin = math.abs( math.sin( CurTime()*1.5 ) )
local eyevec = EyeVector() * -1
eyevec.z = 0
local color_effect = Color( 255, 255, 255 )
render.DrawQuadEasy(
self.Pos,
eyevec,
64 + sin * 4,
32 + sin * 4,
color_effect,
180
)
end
[/lua]
Sorry, you need to Log In to post a reply to this thread.