DarkRP weapon glow

Hi FP and today im going to show you how to make your weapons glow on your DarkRP server, this is pretty usefull on dark maps and it looks pretty sick, lets get started

Difficulty: VERY Easy

Duration: VERY Short

to get started, locate your garrysmod\lua\autorun or if your making an addon, garrysmod\addons\whatever\lua\autorun

after that, your going to want to create a LUA file, inside the LUA file, add this:



hook.Add( "PreDrawHalos", "AddHalos", function()
    for _, ent in pairs( ents.FindByClass( "spawned_weapon" ) ) do
        effects.halo.Add( {ent}, Color( 0, 255, 255 ), 1, 1, 10 )
    end
		end )



i don’t think i need to explain what that means but W/E, its basically telling the client to find all entities called “Spawned_weapon”, which in DarkRP is the weapons bought from gun dealers/labs and adds the “halo” effect to them, the Color( 0, 255, 255 ) is what color the halo shall be, you can change that as you please, i just left it at 0, 255, 255 because i love cyan, after you are done pasting that code, simply save it and start/restart your server, after that, all in-game weapons should glow.

if you have any questions post, ill take some request for the next tutorial, also if you don’t like the structure of the tutorial, simply post and ill fix it for the next one!

Why are you making a table of only one entity with that class when you can just forget the loop and pass the entities from ents.FindByClass.

oh, on my server i made it find not only weapons but cash, drugs etc, so its multiple entities, i just didnt really edit it much before posting here

[lua]
local entities = ents.FindByClass(“spawned_weapon”);

halo.Add(entities, Color(0, 255, 255), 1, 1, 10)
[/lua]

yea, that wold be a lot cleaner, sometimes i don’t make sense :S

You shouldn’t make tutorials if you say that about yourself, and you don’t seem experienced enough for that either, just saying.

Don’t let the perfectionist bring you down, OP. While he is right that his way is more efficient, I can’t stand people who feel they need to one-up others, especially when all they are doing is trying to help.

Anywho, I’m sure a lot of noob server owners will benefit off this tutorial, thanks!

I get FPS lagg when doing this xD

Well the tutorial was originally from the wiki.

Oh, nevermind then, fuck you OP.

reduce the blur, it causes FPS lag