I am getting this error every time I respawn,
ERROR: GAMEMODE:‘PlayerSpawn’ Failed: LemonadeScript/gamemode/init.lua:260: attempt to index global ‘CustomSpawnPoints’ (a nil value)
The whole section on the Custom Spawn Points is here:
[lua]function GM:PlayerSpawn( ply )
if(LEMON.PlayerData[LEMON.FormatSteamID(ply:SteamID())] == nil) then
return;
end
ply:StripWeapons( );
self.BaseClass:PlayerSpawn( ply )
GAMEMODE:SetPlayerSpeed( ply, LEMON.ConVars[ "WalkSpeed" ], LEMON.ConVars[ "RunSpeed" ] );
if( ply:GetNWInt( "deathmode" ) == 1 ) then
ply:SetNWInt( "deathmode", 0 );
ply:SetViewEntity( ply );
end
-- Reset all the variables
ply:ChangeMaxHealth(LEMON.ConVars[ "DefaultHealth" ] - ply:MaxHealth());
ply:ChangeMaxArmor(0 - ply:MaxArmor());
ply:ChangeMaxWalkSpeed(LEMON.ConVars[ "WalkSpeed" ] - ply:MaxWalkSpeed());
ply:ChangeMaxRunSpeed(LEMON.ConVars[ "RunSpeed" ] - ply:MaxRunSpeed());
LEMON.CallHook( "PlayerSpawn", ply )
LEMON.CallTeamHook( "PlayerSpawn", ply ); -- Change player speeds perhaps?
local map = game.GetMap();
if( ply:IsCombine() ) then
if( CustomCPSpawnPoints[map] ) then
local num = math.random( 1, #CustomCPSpawnPoints[map] );
while( num == LastCPSpawn ) do
num = math.random( 1, #CustomCPSpawnPoints[map] );
end
LastCPSpawn = num;
local sp = CustomCPSpawnPoints[map][num];
ply:SetPos( sp.Pos );
ply:SetEyeAngles( sp.Ang );
end
else
if( CustomSpawnPoints[map] ) then
local num = math.random( 1, CustomSpawnPoints[map] );
while( num == LastSpawn ) do
num = math.random( 1, CustomSpawnPoints[map] );
end
LastSpawn = num;
local sp = CustomSpawnPoints[map][num];
ply:SetPos( sp.Pos );
ply:SetEyeAngles( sp.Ang );
end
end
end
[/lua]