Changing a random player's class.


Help needed!
For my fretta based gamemode, I need to select a random player from team 2 every round and set his/her class to VIP.
This is how I’ve been trying to do it but the problem is that when the round starts no-one’s class is changed.

function GM:OnPreRoundStart( num, chosen, ply )

	chosen = table.Random(team.GetPlayers( 2 ) )
	player_manager.SetPlayerClass( chosen, "vip" )

The name of the chosen player gets printed in the console but the player class wont change.
Any help would be appreciated :slight_smile:

Yeah thanks a ton for voting me as dumb and not helping me.