Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Somewhere in an an autorun file 'lua/autorun/client'
- if !ConVarExists("cl_dynamic_tracer") then
- CreateClientConVar("cl_dynamic_tracer", 1, true, false, "Enable/Disable dynamic lighting on Star Wars weapons")
- end
- -- In the actual function file for the tracer effect
- -- If you want to check for the ConVar
- local DynamicTrace = GetConVar("cl_dynamic_tracer")
- function EFFECT:Think()
- self.LifeTime = self.LifeTime - FrameTime();
- self.StartTime = self.StartTime + FrameTime();
- if (DynamicTrace:GetBool()) then
- local spawn = util.CRC(tostring(self:GetPos()))
- local dlight = DynamicLight( self:EntIndex() + spawn)
- local endDistance = self.Speed * self.StartTime;
- local endPos = self.StartPos + self.Normal * endDistance;
- if ( dlight ) then
- dlight.pos = endPos
- dlight.r = 0
- dlight.g = 0
- dlight.b = 153
- dlight.brightness = 3
- dlight.Decay = 1000
- dlight.Size = 300
- dlight.DieTime = CurTime() + 3
- end
- end
- return self.LifeTime > 0;
- end
Advertisement
Add Comment
Please, Sign In to add comment