Gamemode crash on player death

So as the title says, I’m writing a gamemode and whenever the player dies the game crashes. Is there something I’ve missed?

If you have overwritten or hooked anything to playerdeath could you please show the code?

We can’t just solve it without seeing anything :<

Yes.

That’s just it. I haven’t overwritten any of the player death code.

Here’s the gamemode init.lua if it helps:
[lua]
AddCSLuaFile( “cl_init.lua” )
AddCSLuaFile( “shared.lua” )

include( “shared.lua” )
DEFINE_BASECLASS( “gamemode_base” )
local base_models = {
“models/props_junk/wood_pallet001a.mdl”,
“models/props_phx/construct/wood/wood_panel1x1.mdl”,
“models/props_phx/construct/wood/wood_panel1x2.mdl”,
“models/props_phx/construct/wood/wood_panel2x2.mdl”,
“models/props_phx/construct/wood/wood_panel2x4.mdl”,
“models/props_phx/construct/wood/wood_panel4x4.mdl”,
“models/props_junk/wood_crate002a.mdl”,
“models/props_junk/wood_crate001a_damaged.mdl”,
“models/props_wasteland/dockplank01b.mdl”,
“models/Items/item_item_crate.mdl”,
“models/props_phx/construct/wood/wood_curve180x2.mdl”,
“models/props_phx/construct/wood/wood_angle180.mdl”,
“models/props_phx/construct/wood/wood_angle360.mdl”,
“models/props_phx/construct/wood/wood_angle90.mdl”,
“models/props_phx/construct/wood/wood_curve180x1.mdl”,
“models/props_phx/construct/wood/wood_curve360x1.mdl”,
“models/props_phx/construct/wood/wood_curve360x2.mdl”,
“models/props_phx/construct/wood/wood_curve90x1.mdl”,
“models/props_phx/construct/wood/wood_curve90x2.mdl”,
“models/props_phx/construct/wood/wood_dome180.mdl”,
“models/props_phx/construct/wood/wood_dome360.mdl”,
“models/props_phx/construct/wood/wood_dome90.mdl”,
}

local barrel = “models/props_borealis/bluebarrel001.mdl”;

–local center_pos = Vector(0,0,64); – Flatgrass
–local center_pos = Vector(-1909.424316, 3333.431885, 4894.894043); – GM_BigIsland

GM.SpawnPos = {
Wood = Vector(-1909.424316, 3333.431885, 4894.894043),
Barrels = Vector(-1909.424316, 3333.431885, 4894.894043),
Propellers = Vector(-1909.424316, 3333.431885, 4894.894043),
PhysGun = Vector(-1909.424316, 3333.431885, 4894.894043),
Seats = Vector(-1909.424316, 3333.431885, 4894.894043),
Zombies = Vector(1622.061768, 6382.275879, 746.537842),
};

GM.Radius = {
BaseModels = {Min=10,Max=1000},
Zombies = {Min=10,Max=300},
Barrels = {Min=50,Max=1000},
};

GM.Zombies = {
“npc_zombie”,
“npc_zombie_torso”,
“npc_fastzombie”,
“npc_headcrab”,
};

function GM:SpawnResources()
local rand_x,rand_y;
for k,v in pairs(base_models) do
local e = ents.Create(“prop_physics”);
rand_x = math.random(self.Radius.BaseModels.Min,self.Radius.BaseModels.Max);
rand_y = math.random(self.Radius.BaseModels.Min,self.Radius.BaseModels.Max);
e:SetPos(self.SpawnPos.Wood + Vector(rand_x,rand_y,0));
e:SetModel(v);
e:Spawn();
e:Activate();
print(rand_x);
print(rand_y);
end

for i=1,10 do
	local b = ents.Create("prop_physics");		
	rand_x = math.random(self.Radius.Barrels.Min,self.Radius.Barrels.Max);
	rand_y = math.random(self.Radius.Barrels.Min,self.Radius.Barrels.Max);
	b:SetPos(self.SpawnPos.Barrels + Vector(rand_x,rand_y,0));
	b:SetModel(barrel);
	b:Spawn();
	b:Activate();
end

for i=1,2 do
	local p = ents.Create("weapon_physgun");
	rand_x = math.random(self.Radius.BaseModels.Min,self.Radius.BaseModels.Max);
	rand_y = math.random(self.Radius.BaseModels.Min,self.Radius.BaseModels.Max);
	p:SetPos(self.SpawnPos.PhysGun + Vector(rand_x,rand_y,0));
	p:Spawn();
	p:Activate();
end

for i=1,5 do
	local c = ents.Create("prop_vehicle_prisoner_pod");
	c:SetModel("models/nova/airboat_seat.mdl");
	rand_x = math.random(self.Radius.Barrels.Min,self.Radius.Barrels.Max);
	rand_y = math.random(self.Radius.Barrels.Min,self.Radius.Barrels.Max);
	c:SetPos(self.SpawnPos.Seats + Vector(rand_x,rand_y,0));
	c:Spawn();
	c:Activate();
	c.BoatChair = true;
end


for i=1,10 do
	local prop = ents.Create("boat_propeller");
	rand_x = math.random(self.Radius.Barrels.Min,self.Radius.Barrels.Max);
	rand_y = math.random(self.Radius.Barrels.Min,self.Radius.Barrels.Max);
	prop:SetPos(self.SpawnPos.Propellers + Vector(rand_x,rand_y,0));
	prop:Spawn();
	prop:Activate();
end

end

function GM:SpawnZombies()
for i=1,4 do
for k,v in pairs(self.Zombies) do
local e = ents.Create(v);
rand_x = math.random(self.Radius.BaseModels.Min,self.Radius.BaseModels.Max);
rand_y = math.random(self.Radius.BaseModels.Min,self.Radius.BaseModels.Max);
e:SetPos(self.SpawnPos.Zombies + Vector(rand_x,rand_y,0));
e:Spawn();
e:Activate();
end
end
end

function GM:PlayerInitialSpawn()

self:SpawnResources();
self:SpawnZombies();

end

function GM:PlayerEnteredVehicle(p,v)
if(v.BoatChair) then
if(v.Linked) then
p.Driving = true;
p.BoatSeat = v;
end
end
end
function GM:KeyPress(p, key)
if(p.Driving) then
if (key == IN_FORWARD) then
p.BoatSeat.Propeller:StartThruster();
end
end
end

function GM:PlayerPostThink§
if(p:IsValid()) then
if(p:WaterLevel() > 1) then
if(not p.WaterTimer) then
timer.Create( “WaterTimer”…p:GetClassID(), 10, 1, function() p:SetPos(Vector(0,0,0)); p.WaterTimer = false; p:Kill() end );
p.WaterTimer = true;
else
p:PrintMessage(HUD_PRINTCENTER,“You’re going to drown in " … math.Round(timer.TimeLeft(“WaterTimer”…p:GetClassID())) … " seconds”);
end
else
if(p.WaterTimer) then
timer.Destroy(“WaterTimer”…p:GetClassID());
p.WaterTimer = false;
end
end
end
end

function GM:PlayerLeaveVehicle(p,v)
if(v.BoatChair) then
p.Driving = false;
p.BoatSeat.Propeller:StopThruster();
end
end

function GM:KeyRelease(p, key)
if(p.Driving) then
if(key == IN_FORWARD) then
p.BoatSeat.Propeller:StopThruster();
end
end

end

function GM:PlayerSpawn§
p:Give(“weapon_crowbar”);
p:Give(“weapon_physcannon”);
p:Give(“weld_gun”);
end
[/lua]

You need to give the player a valid player model.

Thank you! Works perfectly now.