Admin only player models

Any way to make player models admin only?



local function checkPlayerModel(ply)
   if ply:GetModel() == "insert admin model here" and not ply:IsAdmin() then
      ply:SetModel("insert default model here")
   end
end
hook.Add("CheckPlayerModel", "UniqueIdentifier", checkPlayerModel)


Yes.

Which game-mode are you referring to? What have you tried coding so far? I recommend looking into the PlayerSpawn hook which calls Loadout and the PlayerSetModel hooks. Primarily, you’re looking at the PlayerSetModel hook, and you should then assign a model based on group in there.


local function checkGroup( ply )
	if ply:IsUserGroup( 'admin' ) then
	ply:SetModel( 'MODEL PATH' )
	end
end
hook.Add("CheckGroup", "UniqueIdentifier", checkGroup)

I think you can do it this way as long as your using ULX admin.

That just forces admins to a model and doesn’t stop players from using it.

But won’t it check if they are the certain group before setting their model?

Not if you’re running sandbox or some other gamemode that allows you to manually change your playermodel. Also, your snippets of code won’t even do anything (neither of you) because neither “CheckPlayerModel” nor “CheckGroup” are valid hooks (unless defined by a gamemode.)