Making NPCs "Keep Corpses" Serverwide

How can I make it so every NPC on the server is marked to keep the corpse? Right now each player has to individually tick “Keep Corpses.”

-bump-

When they join you could run a concommand on their client to change the cvar to 1.



function GM:PlayerInitialSpawn( ply )
	ply:ConCommand( "ai_keepragdolls 1" )
end


when I enter ai_keepragdolls 1 into my own console it says that it is an unknown command so I figure that there is another command for this.

Odd. Garry probably changed the CVar. Try ai_force_serverside_ragdoll 1

This would go in cl_init.lua, correct?

Type it in console or you can put it in your server.cfg

no, your function



function GM:PlayerInitialSpawn( ply )
	ply:ConCommand( "ai_keepragdolls 1" )
end


would go in cl_init.lua

No, init.lua. 100% chance it already exists so just add the concommand to the current hook.

Alright, it worked, thank you

No problem. Go ahead and mark this as solved.