Help! 2d3d model outline rendering!

Okay, so I have been trying for the past few hours to make a player have an outline around them, a bit like this (but with a player of course).

I have tried what seems like everything (I am not the best coder)

I know how it should work:

2d3d renders the players model + 2px in black
the playermodel is rendered in 3d over the top of the black 2d3d render

Help? Can someone explain how I should do this?

I coded something a while back for entities. I haven’t ever tried it on a player but:

[lua]local MAT_WHITE_OUTLINE = Material( “white_outline” )
local MAT_BLACK_OUTLINE = Material( “black_outline” )[/lua]

is needed.

I basically did a few render tricks, suppress lighting, then scaling the model up the largest amount and overriding the material to black, scaling it up just a little more and using white override, then setting scale to normal and removing overrides.

Okay, I will be sure to use those materials when I figure this out.

You don’t need 3d2d. Just make a copy of the model, scale it inside-out and a little bit bigger, and color it black.

Wouldn’t that just make a model inside a model, the outside one being black and the inside one not being visible?

No, because you’re rendering the other on top of the other; at least with the outline materials it works like that.

OH I get it now, so the outside render is just an outline! Thanks guys, I will try that now c:

[editline]1st September 2013[/editline]

How would I scale the outline model up a few pixels?

using ply:SetModelScale()

[editline]1st September 2013[/editline]

uhh

[editline]1st September 2013[/editline]

Is there any way I can make the black only show when the player is behind a wall or a prop?