Gamemode help

I have no clue why this isn’t working. When I try and start the game it just crashes. I’m trying to create a class “Ghost”, I copied the layout of all the other classes but Its still crashing my game.

Shared
[LUA]
team.SetUp( 1, “Citizen”, Color( 52, 163, 55, 255 ) )
team.SetUp( 2, “Mayor”, Color( 230, 32, 32, 255 ) )
team.SetUp( 3, “Police Officer”, Color( 83, 35, 226, 255) )
team.SetUp( 4, “Ghost”, Color( 52, 16, 55, 255 ) )
[/LUA]

Init
[LUA]
function GM:PlayerLoadout( ply )

if ply:Team() == 1 then

	ply:Give( "weapon_physcannon" )
	ply:Give( "weapon_physgun" )
	ply:Give( "gmod_tool" )
	ply:SetSalary(15, 10)
	ply:SetModel( "models/player/Group01/Male_04.mdl" )


elseif ply:Team() == 2 then

	ply:Give( "weapon_physcannon" )
	ply:Give( "weapon_physgun" )
	ply:Give( "gmod_tool" )
	ply:SetSalary(75,10)
	ply:SetModel( "models/player/breen.mdl")
	
elseif ply:Team() == 3 then

	ply:Give( "weapon_physcannon" )
	ply:Give( "weapon_physgun" )
	ply:Give( "gmod_tool" )
	ply:Give("item_ammo_pistol")
	ply:Give( "weapon_deagle" )
	ply:SetSalary(50,10)
	ply:SetModel( "models/player/police.mdl" )
	
elseif ply:Team() == 4 then

	ply:SetModel( "models/player/police.mdl" )
	
end

end

function citizen( ply )

ply:SetTeam( 1 )
ply:StripWeapons();
ply:Spawn()
ply:SetModel( "models/player/Group01/Male_04.mdl" )

end
concommand.Add( “rp_citizen”, citizen )

function mayor( ply )

ply:SetTeam( 2 )
ply:StripWeapons();
ply:Spawn()
ply:SetModel( "models/player/breen.mdl")

end
concommand.Add( “rp_mayor”, mayor )

function PoliceOfficer( ply )

ply:SetTeam( 3 )
ply:StripWeapons();
ply:Spawn()
ply:SetModel( "models/player/police.mdl" )

end
concommand.Add( “rp_police”, PoliceOfficer )

function Ghost( ply )

ply:SetTeam( 4 )
ply:StripWeapons()
ply:Spawn()
ply:SetModel( "models/player/police.mdl" )

end
concommand.Add( “rp_Ghost”, Ghost)
[/LUA]

I can’t see if I get any errors since it crashes right as I’m about to join. And when I Remove everything involving Ghost it doesn’t crashes.

I don’t see why that should crash, it is set up correctly.

Is there an error message that comes with the crash, or does it just go straight to the desktop?

This probably won’t make much sense, but the only difference between ‘Ghost’ and the other team-names / functions is that the team name is the same name as the function name. Try changing it to something different and let me know.

To be honest, that IS the only thing that could remotely be connected to the crash, otherwise there’s another file in your gamemode folder that you’re hiding from us :wink:

It crashes and I go strait to the desktop and my init and shared are the only things that have anything to do with this team.

[editline]03:11PM[/editline]

Hmmm… I got it working by changing Ghost to ghost. I guess you were right _nonSENSE.

Maybe because he never said what SetSalary() is?

EDIT: Nevermind, he fixed it so I guess that’s not the issue :stuck_out_tongue:

I guess _nonSENSE gives _someSENSE afterall :downs:

I do my best :wink:. Glad I could help out.