SetModelScale of Players HELP!!!!

**[Entity.SetModelScale

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Entity.SetModelScale)**

I am using Entity.SetModelScale of players to change the size of the player model, but it is not working. I have been using it in a function that is hooked to RenderScene, is this wrong? What should I be hooking to?

You could either put it in **[Gamemode.PrePlayerDraw

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.PrePlayerDraw)** or **[Gamemode.RenderScreenspaceEffects

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.RenderScreenspaceEffects)**

Are you sure you need to call this in an actual hook? It seems like a function you only have to run once and the effect sticks.

Yea just run it once.

Yes I am pretty sure I need it in a hook. I want to draw a black outline around the players, so I am going to draw the player a little bigger and use stencils to colour in black, then draw the player normally over the top if this makes sense.

Thanks for the help guys, if this does not work I will get back to you.

Pretty sure this doesn’t need to be done in a hook.

Hmmm maybe I am going about this wrong. I used this sample code which draws an outline around props, except I am trying to do it around a player instead. I tried using it on a player entity but it seemed that SetModelScale didnt work in the same way for players.



local matOutline = CreateMaterial( "BlackOutline", "UnlitGeneric", { [ "$basetexture" ] = "vgui/black" } )
 
hook.Add( "PostDrawOpaqueRenderables", "PostDrawing", function()
	cam.Start3D( EyePos(), EyeAngles() )
 
	// First we clear the stencil and enable the stencil buffer
	render.ClearStencil()
	render.SetStencilEnable( true )
 
	// First we set every pixel with the prop + outline to 1
	render.SetStencilFailOperation( STENCILOPERATION_KEEP )
	render.SetStencilZFailOperation( STENCILOPERATION_REPLACE )
	render.SetStencilPassOperation( STENCILOPERATION_REPLACE )
	render.SetStencilCompareFunction( STENCILCOMPARISONFUNCTION_ALWAYS )
	render.SetStencilReferenceValue( 1 )
 
	for _, ent in pairs( ents.FindByClass( "prop_physics*" ) ) do
		ent:SetModelScale( Vector( 1.1, 1.1, 1.1 ) )
		print( ent:GetModelScale() )
		ent:DrawModel()
		ent:SetModelScale( Vector( 1, 1, 1 ) )
	end
 
	// Now we set every pixel with only the prop to 2
	render.SetStencilReferenceValue( 2 )
 
	for _, ent in pairs( ents.FindByClass( "prop_physics*" ) ) do
		ent:DrawModel()
	end
 
	// Now we only draw the pixels with a value of 1 black, which are the pixels with only the outline
	render.SetStencilCompareFunction( STENCILCOMPARISONFUNCTION_EQUAL )
	render.SetStencilPassOperation( STENCILOPERATION_REPLACE )
	render.SetStencilReferenceValue( 1 )
 
	render.SetMaterial( matOutline )
	render.DrawScreenQuad()
 
	// Disable the stencil buffer again
	render.SetStencilEnable( false )
 
	cam.End3D()
end )