• giving a entity a trail
    0 replies, posted
ive tried using other trail codes from madcows weapons pack and others but mabye its not compatible with it or something every time its says null entity can you please just add a line to the code to make a trail with the colors 217 213 235 255 laser.vmt trail start size .95 end size .5 heres the code AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) include( "shared.lua" ) function ENT:Initialize() self.Entity:SetModel( "models/weapons/bt_762.mdl" ) self.Entity:PhysicsInit( SOLID_VPHYSICS ) self.Entity:SetSolid( SOLID_NONE ) self.Entity:SetMoveType( MOVETYPE_VPHYSICS ) local phys = self.Entity:GetPhysicsObject( ) if phys:IsValid( ) then phys:EnableGravity( false ) phys:Wake( ) end self.Start = CurTime( ) end function ENT:PhysicsUpdate( PhysObj ) if self.Start < CurTime( ) - ( 10 / GetConVarNumber( "phys_timescale" ) ) then self.Entity:Remove( ) return end local Trace = { start = self.Entity:GetPos( ), endpos = self.Entity:GetPos( ) + ( self.Entity:GetForward( ) * 20 ), filter = self.Entity } local TraceRes = util.TraceLine( Trace ) if TraceRes.Hit or TraceRes.HitWorld then if TraceRes.Entity:GetClass( ) ~= "physical_bullet" then local Bullet = { Src = self.Entity:GetPos( ), Dir = self.Entity:GetForward( ), Spread = 0, Num = 1, Damage = self.Damage, Force = self.Force, Tracer = 0, TracerName = "Pistol" } self.Owner:FireBulletsOld( Bullet ) self.Entity:Remove( ) return false end end PhysObj:SetVelocity( self.Entity:GetForward( ) * 10000 ) end
Sorry, you need to Log In to post a reply to this thread.