Custom Gamemode Hand Model issue

I’m trying to get the hand models to work for my custom gamemode but i’m having an issue.

i get this error in the console


[ERROR] gamemodes/casino/gamemode/init.lua:40: attempt to index global 'GM' (a nil value)
  1. unknown - gamemodes/casino/gamemode/init.lua:40
   2. Spawn - [C]:-1
    3. unknown - gamemodes/base/gamemode/player.lua:110


And i get errors for hands

This is my ini.lua



AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )

include( 'shared.lua' )


// Serverside only stuff goes here

/*---------------------------------------------------------
   Name: gamemode:PlayerLoadout( )
   Desc: Give the player the default spawning weapons/ammo
---------------------------------------------------------*/
function GM:PlayerInitialSpawn( ply )

    ply:SetGravity( 1 )
    ply:SetWalkSpeed( 300 )
	ply:SetRunSpeed( 500 )
	ply:SetTeam( 2 )
	
end

function GM:PlayerSpawn( ply )
    if ply:Team() == 1 then
	   ply:Give("weapon_stunstick")	
	   ply:SetModel("models/player/arctic.mdl")
	   ply:SetupHands()
	end
	    if ply:Team() == 2 then
	   ply:Give("weapon_pistol")
	   ply:SetModel("models/player/leet.mdl")
	   ply:SetupHands()
	end
    if ply:Team() == 3 then
	   ply:Give("weapon_AR2")
	   ply:SetModel("models/player/alyx.mdl")
	   ply:SetupHands()
	end
	
	function GM:PlayerSetHandsModel( ply, ent )
	local simplemodel = player_manager.TranslateToPlayerModelName( ply:GetModel() )
	local info = player_manager.TranslatePlayerHands( simplemodel )
	if ( info ) then
		ent:SetModel( info.model )
		ent:SetSkin( info.skin )
		ent:SetBodyGroups( info.body )
	end
end

	
////////////////////////
//// Team balancing/////
////////////////////////

local RDM = math.random( 1, 2)

    if RDM == 1 then
	ply:SetTeam( 1 )
	elseif RDM == 2 then
		ply:SetTeam( 2 )
	elseif RDM == 3 then
		ply:SetTeam( 3 )
end
SPEN = team.NumPlayers( 1 ) 
DEAL = team.NumPlayers( 2 )
BANK = team.NumPlayers( 3 )

	if DEAL > SPEN then
		ply:SetTeam ( 2 )
	elseif SPEN > DEAL then
		ply:SetTeam ( 1 )
	elseif BANK > SPEN then
		ply:SetTeam ( 2 )
	end
end

function TUT_START()
	RDN = math.random
	ply.SetTeam( RDM )
end

//Console Commands
concommand.Add( "TUT_START", TUT_START )
concommand.Remove( "kill" )