init.lua won't load

I know some of you hate the perp gamemode. I already found a lot of stuff that had to be changed because of Garry’s Mod 13, but I keep getting this error and I really don’t know what to do, I’m stuck. Hope some of you can help me out :slight_smile:

[lua]
local OldAddCSLuaFile = AddCSLuaFile;
local ClientLuaFiles = 0;
function AddCSLuaFile ( File )
ClientLuaFiles = ClientLuaFiles + 1;
OldAddCSLuaFile(File);
end

// GM.MonitorStockPrices = true;

local ClientResources = 0;
local function ProcessFolder ( Location )
for k, v in pairs(file.Find(Location … ‘*’)) do
if file.IsDir(Location … v) then
ProcessFolder(Location … v … ‘/’)
else
local OurLocation = string.gsub(Location … v, ‘…/gamemodes/perp/content/’, ‘’)

		local Is420Model = tobool(string.find(OurLocation, "420day"));
		local Is420Day = tobool(os.date('%m%d') == "0420");
		
		if GM.IsSeriousRP() then Is420Day = false; end

		if !string.find(Location, '.db') and !string.find(Location, "perp/billboards") and ((Is420Day and Is420Model) or !Is420Model) then			
			ClientResources = ClientResources + 1;
			resource.AddFile(OurLocation);
		end
	end
end

end

AddCSLuaFile(‘sh_init.lua’);
AddCSLuaFile(‘sh_player.lua’);
AddCSLuaFile(‘cl_networking.lua’);
AddCSLuaFile(‘cl_misc.lua’);
AddCSLuaFile(‘cl_init.lua’);
AddCSLuaFile(‘cl_hooks.lua’);
AddCSLuaFile(‘sh_ent.lua’);
AddCSLuaFile(‘sh_helpers.lua’);
AddCSLuaFile(‘sh_newspaper.lua’);
AddCSLuaFile( “cl_scoreboard.lua” )
AddCSLuaFile( “sh_post.lua” )
//AddCSLuaFile( “sh_peulhl.lua” )

AddCSLuaFile( “scoreboard/player_frame.lua” )
AddCSLuaFile( “scoreboard/player_row.lua” )
AddCSLuaFile( “scoreboard/scoreboard.lua” )

for k, v in pairs(file.Find(‘perp/gamemode/vgui/.lua’,‘LUA’)) do AddCSLuaFile(‘vgui/’ … v); end
for k, v in pairs(file.Find('perp/gamemode/cl_modules/
.lua’, ‘LUA’)) do AddCSLuaFile(‘cl_modules/’ … v); end
for k, v in pairs(file.Find(‘perp/gamemode/items/.lua’, ‘LUA’)) do AddCSLuaFile(‘items/’ … v); end
for k, v in pairs(file.Find('perp/gamemode/dev_tools/
.lua’, ‘LUA’)) do AddCSLuaFile(‘dev_tools/’ … v); end
for k, v in pairs(file.Find(‘perp/gamemode/shops/.lua’, ‘LUA’)) do AddCSLuaFile(‘shops/’ … v); end
for k, v in pairs(file.Find('perp/gamemode/mixtures/
.lua’, ‘LUA’)) do AddCSLuaFile(‘mixtures/’ … v); end
for k, v in pairs(file.Find(‘perp/gamemode/npc_scripts/.lua’, ‘LUA’)) do AddCSLuaFile(‘npc_scripts/’ … v); end
for k, v in pairs(file.Find('perp/gamemode/scoreboard/
.lua’, ‘LUA’)) do AddCSLuaFile(‘scoreboard/’ … v); end
for k, v in pairs(file.Find(‘perp/gamemode/property/evo1/.lua’, ‘LUA’)) do AddCSLuaFile(‘property/evo1/’ … v); end
for k, v in pairs(file.Find('perp/gamemode/property/evo2/
.lua’, ‘LUA’)) do AddCSLuaFile(‘property/evo2/’ … v); end
//for k, v in pairs(file.FindInLua(‘perp/gamemode/peulhl_functions/.lua’)) do AddCSLuaFile(‘peulhl_functions/’ … v); end
//for k, v in pairs(file.FindInLua('perp/gamemode/peulhl_parser/
.lua’)) do AddCSLuaFile(‘peulhl_parser/’ … v); end

include(‘sh_init.lua’);

GM.FistDamage = 10;

if !game.SinglePlayer() then
ProcessFolder(’…/gamemodes/perp/content/models/’, ‘GAME’);
ProcessFolder(’…/gamemodes/perp/content/materials/’, ‘GAME’);
ProcessFolder(’…/gamemodes/perp/content/sound/’, ‘GAME’);
ProcessFolder(’…/gamemodes/perp/content/settings/’, ‘GAME’);
end
include(‘sv_pe_reqs.lua’);
include(‘sv_hooks.lua’);
include(‘sv_player.lua’);
include(‘sv_misc.lua’);
include(‘sv_networking.lua’);
include(‘sv_items.lua’);
include(‘sv_chat.lua’);
include(‘sv_npc_control.lua’);

for k, v in pairs(file.Find(‘perp/gamemode/sv_modules/*.lua’, ‘LUA’)) do include(‘sv_modules/’ … v); end

RunConsoleCommand(‘ai_ignoreplayers’, ‘1’);

GM.MaxDoors = 5;
GM.DoorCost = 100;

// random variables
GM.CopReward_Shrooms = 50;
GM.CopReward_Weed = 100;
GM.CopReward_Arrest = 100;
GM.AutomaticUnwarrant = 600;
GM.ArrestTable = {};
GM.HouseAlarms = {};

// Tell us the shitz.
Msg('Sent a total of ’ … ClientLuaFiles … ’ client lua files.
');
Msg('Sent a total of ’ … ClientResources … ’ client resources.
');

function GM:PlayerConnect ( Name, Address, SteamID )
if !Go then
Go = true;
file.Write(‘perp_ip_log.txt’, ‘’);
end

file.Write('perp_ip_log.txt', file.Read('perp_ip_log.txt') .. math.Round(CurTime()) .. ' : ' .. tostring(Name) .. ' -> ' .. tostring(Address) .. ' -> ' .. tostring(SteamID) .. '

')
end

include(‘sh_post.lua’);

RunConsoleCommand(“sv_usermessage_maxsize”, “2048”);
[/lua]

change on line 12
for k, v in pairs(file.Find(Location … ‘’)) do
to
for k, v in pairs(file.Find(Location … '
’, ‘GAME’)) do

Thanks, but that gave me a new error.

[ERROR] gamemodes/perp/gamemode/init.lua:12 bad argument #1 to ‘pairs’ <table expected, got no value>

What about the error at line 5, is there anything I have to change?

on line 5 change it to
OldAddCSLuaFile = file

If you don’t know how to fix these simple things I don’t think you should try to port PERP.