Admin Only NPCS

How to make NPC’s admin only? I got Skyrim NPCs but of course will so many idiots around, it’d be abused and there would be dragons everywhere. How can I admin only them?



function NPCSpawn( pl, npc_type, npc_weapon )
 
   if pl:IsAdmin() then return true end
 
return false
end
hook.Add( "PlayerSpawnNPC", "playerSpawnNPCTest", NPCSpawn );


http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexb80c.html

oh… nice coding =)

mb better:



function NPCSpawn( pl, npc_type, npc_weapon )
    return pl:IsAdmin()
end
hook.Add( "PlayerSpawnNPC", "playerSpawnNPCTest", NPCSpawn );