PointShop Player models and team player models

I have been trying for a while to make my player models turn to a team player model when on a certain team. I have got my script here but It doesn’t seem to change to the models/player/police.mdl when on TEAM_GUARD… I feel that something is contridicting the other, but can’t figure out a way round it or which way I am going to do it. Sorry if the script is a bit messy… Everything I make is :smiley:



ITEM.Name = 'Batman'
ITEM.Price = 500
ITEM.Model = 'models/Batman/slow/jamis/mkvsdcu/batman/slow_pub_v2.mdl'

function ITEM:OnEquip(ply, modifications)
	if not ply._OldModel then
		ply._OldModel = ply:GetModel()
	end
	
	timer.Simple(1, function() ply:SetModel(self.Model) end)
end

function ITEM:OnHolster(ply)
	if ply._OldModel and ply:Team("TEAM_GUARD") then
		ply:SetModel("models/player/police.mdl")
	elseif ply._OldModel and ply:Team("TEAM_PRISONER") then
		ply:SetModel("models/player/Group01/Male_01.mdl")
	end
end

function GuardModel(ply)
    if ply:Team("TEAM_GUARD") then
	    ply:SetModel("models/player/police.mdl")
	elseif ply:Team("TEAM_PRISONER") then
		ply:SetModel("models/Batman/slow/jamis/mkvsdcu/batman/slow_pub_v2.mdl")
	end
end
		


Still haven’t got anywhere

Have you even tried researching for Player:Team()?

If you did you could easily see you’re using it wrong.

-snip-

I’m so stupid sometimes :C

I’m going to just try this. I was going to make classes at some point anyway because the character system messed up everything.



function PLAYER:OnSpawn( pl )
	
	pl:SetBloodColor(BLOOD_COLOR_RED)
	pl:SetPlayerColor( Vector( 0.5,0.5,0 ) )
	timer.Simple(2, function(pl) ply:SetModel("models/player/police.mdl") end)

end


You are using ply:SetModel, while the function uses pl