• swep help required
    2 replies, posted
Hello I am working on a swep that supposingly functions as a flashlight, but brighter in a way, it is for my roleplay servers police force, [CODE]function SWEP:PrimaryAttack() if ( !self:CanPrimaryAttack() ) then return end local light = DynamicLight(LocalPlayer():EntIndex()) if ( light ) then light.pos = "ValveBiped.Bip01_R_Hand" light.r = 255 light.g = 255 light.b = 255 light.brightness = 10 light.Decay = 1000 light.Size = 256 end[/CODE] the code given above is certainly wrong but I dont know what is wrong or what I should do instead
You need to call DynamicLight in a think hook or something similar.
Better yet, create a projected texture if it doesn't already exist, and update/draw it postviewmodel. That'll give it shadows and control the direction/fov of the light.
Sorry, you need to Log In to post a reply to this thread.