Cl.init not loading shared.lua and sh_meta.lua

So I made my own simple gamemode but every time I try to run it here are the errors I get
[lua][[ʁʁ] Vontae|2|STEAM_0:0:29268854] Lua Error:
Couldn’t include file ‘shared.lua’ (File not found) (@gamemodes/teamdeathmatch/gamemode/cl_init.lua (line 1))

[[ʁʁ] Vontae|2|STEAM_0:0:29268854] Lua Error:
Couldn’t include file ‘sh_meta.lua’ (File not found) (@gamemodes/teamdeathmatch/gamemode/cl_init.lua (line 2))[/lua]

Heres my shared.lua code
[lua]GM.Name = “Team DeathMatch”
GM.Author = “VontaeGames”
GM.Email = “vontaegames@gmail.com
GM.Website = “N/A”

function GM:Initialize()

self.BaseClass.Initialize( self )

end
// Team for Free For All here

team.SetUp(1, “Federal”, Color(150, 0, 255))
team.SetUp(2, “Terrorists”, Color(255, 150, 0))

//Default Model setup for the teams
//Will need custom pointshop—Will be added later

util.PrecacheModel(“models/player/artic.mdl”)
util.PrecacheModel(“models/player/leet.mdl”)
util.PrecacheModel(“models/player/breen.mdl”)
util.PrecacheModel(“models/player/kleiner.mdl”)

//Timers
//Round timer???

timer.Create( “Team”, 10, 5, TeamT )[/lua]

And heres my cl.init
[lua]include( “shared.lua” )
include( “sh_meta.lua” )
// Clientside only stuff goes here

function HUDHide( myhud )
if myhud == “CHudHealth” or myhud == “CHudBattery” then
return false
end
end
hook.Add( “HUDShouldDraw”, “HUDHide”, HUDHide )

function BetterHUD()
local ply = LocalPlayer()
local HP = ply:Health()
local ARM = ply:Armor()
local wep = ply:GetActiveWeapon()

surface.DrawText( HP )
surface.DrawText("Health")
draw.RoundedBox( 6, 100, ScrH() - 100, 200, 40, Color ( 85, 52, 100, 120) )
draw.RoundedBox( 4, 100, ScrH() - 100, math.Clamp( HP, 0, 200)*2, 40, Color ( 220, 0, 0, 255))
draw.RoundedBox( 4, 100, ScrH() - 100, math.Clamp( HP, 0, 200)*2, 10, Color ( 255,255,255,40) )

end
hook.Add( “HUDPaint”, “BetterHUD”, BetterHUD )
function gunname()
if LocalPlayer():GetActiveWeapon():IsValid() then
draw.DrawText( “”…LocalPlayer():GetActiveWeapon().PrintName, “BudgetLabel”, ScrW() * 0.9, ScrH() * 0.75, Color( 255,255,255,255 ), TEXT_ALIGN_CENTER )
draw.DrawText( “”…LocalPlayer():GetActiveWeapon():Clip1(), “BudgetLabel”, ScrW() * 0.88, ScrH() * 0.77, Color( 255,255,255,255 ), TEXT_ALIGN_CENTER )
draw.DrawText( “/”…LocalPlayer():GetActiveWeapon():Ammo1(), “BudgetLabel”, ScrW() * 0.9, ScrH() * 0.77, Color( 255,255,255,255 ), TEXT_ALIGN_CENTER )
end
end
hook.Add( “HUDPaint”, “Weapon stats”, gunname )

//Welcome message Function
function WMsg()
chat.AddText(Color(255, 75, 255), "[CG] ", Color(120, 0, 255), “Welcome to TDM. ENJOY!!!”)
end
usermessage.Hook( “Welcome”, WMsg )

function ShowTeamMenu()
local DermaPanel = vgui.Create( “DFrame” )
DermaPanel:SetPos( 50,50 )
DermaPanel:SetSize( 200, 250 )
DermaPanel:SetTitle( “Team Selection” ) // Name of Fram
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( false ) //Can the player drag the frame /True/False
DermaPanel:ShowCloseButton( false ) //Show the X (Close button) /True/False
DermaPanel:MakePopup()

local DermaButton = vgui.Create( “DButton” )
DermaButton:SetParent( DermaPanel ) // Set parent to our “DermaPanel”
DermaButton:SetText( “Federal” )
DermaButton:SetPos( 25, 50 )
DermaButton:SetSize( 150, 50 )
DermaButton.DoClick = function ()
RunConsoleCommand( “team_menu” ) // What happens when you press the button
end

local DermaButton = vgui.Create( “DButton” )
DermaButton:SetParent( DermaPanel ) // Set parent to our “DermaPanel”
DermaButton:SetText( “Terrorist” )
DermaButton:SetPos( 25, 300 )
DermaButton:SetSize( 150, 50 )
DermaButton.DoClick = function ()
RunConsoleCommand( “team_menu” ) // What happens when you press the button
end

end

hook.Add( “HUDPaint”, “PaintVIP”, function()
local rank = LocalPlayer():GetNWInt( “Rank” )
local d
if ( rank == 1 ) then d = “VIP” else d = “Guest” end

end )[/lua]

And heres my sh_meta.lua
[lua]local pl = FindMetaTable( “Player” )

function pl:IsVIP()
if( self:IsAdmin() or self:IsSuperAdmin() or self:GetNWInt( “Rank” ) == 1 ) then
return true
else
return false
end
end

function pl:SaveVIP()
self:SetPData( “Rank”, self:GetNWInt( “Rank” ) )
end

function pl:GiveVIP()
self:SetNWInt( “Rank”, 1 )
SaveVIP()
end

function pl:TakeVIP()
self:SetNWInt( “Rank”, 0 )
SaveVIP()
end[/lua]

Probably because you didn’t AddCSLuaFile() them in init.lua.

I redid this now this is what i have in my init.lua
[lua]AddCSLuaFile(“sh_meta.lua”)
AddCSLuaFile(“cl_init.lua”)
AddCSLuaFile(“shared.lua”)

include(“shared.lua”)
include(“sh_meta.lua”)

// Serverside only stuff goes here

/---------------------------------------------------------
Name: gamemode:PlayerLoadout( )
Desc: Give the player the default spawning weapons/ammo
---------------------------------------------------------
/
function GM:PlayerLoadout ( pl )
pl:SetTeam( 1 )
pl:StripWeapons()
pl:GodEnable()
function GM:PlayerInitialSpawn( pl )
//user Messaging
umsg.Start(“Welcome to TDM”, pl)
umsg.End()
end
ply:ConCommand( “team_menu” ) --Run the console command when the player first spawns
//End
pl:SetGravity( 1 )
pl:SetWalkSpeed( 250 )
pl:SetRunSpeed( 450 )
pl:Give( “weapon_stunstick” )
pl:Give( “weapon_pistol” )
pl:Give( “weapon_smg1” )
pl:GiveAmmo(255, “pistol” )
pl:GiveAmmo(480, “smg1” )
pl:SetTeam( 1 )
timer.Start(“Team”)
end

function GM:PlayerSpawn ( pl )
if pl:Team()== 1 then
pl:Give( “weapon_pistol” )
pl:Give( “weapon_smg1” )
pl:Give( “weapon_stunstick” )
pl:GiveAmmo(255, “pistol” )
pl:GiveAmmo(480, “smg1” )
pl:SetModel(“models/player/artic.mdl”)
end
if pl:Team()== 2 then
pl:Give( “weapon_pistol” )
pl:Give( “weapon_smg1” )
pl:Give( “weapon_stunstick” )
pl:GiveAmmo(255, “pistol” )
pl:GiveAmmo(480, “smg1” )
pl:SetModel(“models/player/leet.mdl”)
end
if pl:Team()== 3 then
pl:Give( “weapon_empty” )
pl:SetRunSpeed( 900 )
pl:SetModel(“models/player/breen.mdl”)
end
//Now setting up team inequality/balance system
//This is a random statement

//////////////////
function TeamT ()
local RND = math.random( 1, 2 )

if RND == 1 then
	pl:SetTeam( 1 )
elseif RND == 2 then
	pl:SetTeam( 2 )

end
//Extra Balancing Variable
FBI = team.NumPlayers( 1 )
TER = team.NumPlayers( 2 )
if FBI > TER then
pl:SetTeam( 2 )
elseif TER > FBI then
pl:SetTeam( 1 )
end
end
timer.pause(“Team”)
end

function TDM_START
RND = math.random( 1, 2 )
ply:SetTeam( RND )
end
concommand.Add( “TDM_START”, TDM_START )
concommand.Remove( “kill” )

function mycommand( "ply, text, public )
if( string.sub( text, 1, 6) == “!rules” ) then
print( “Press F1 to find the rules” )
end
end
hook.Add( “PlayerSay”, “mycommand”, mycommand )
//More Timers

round = {}

– Variables
round.Break = 30 – 30 second breaks
round.Time = 600 – 5 minute rounds

– Read Variables
round.TimeLeft = -1
round.Breaking = false

function round.Broadcast(Text)
for k, v in pairs(player.GetAll()) do
v:ConCommand(“play buttons/button17.wav”)
v:ChatPrint(Text)
end
end

function round.Begin()
– Your code
– (Anything that may need to happen when the round begins)

round.Broadcast("Round starting! Round ends in " .. round.Time .. " seconds!")
round.TimeLeft = round.Time

end

function round.End()
– Your code
– (Anything that may need to happen when the round ends)

round.Broadcast("Round over! Next round in " .. round.Break .. " seconds!")
round.TimeLeft = round.Break

end
function round.Handle()
if (round.TimeLeft == -1) then – Start the first round
round.Begin()
return
end

round.TimeLeft = round.TimeLeft - 1

if (round.TimeLeft == 0) then
	if (round.Breaking) then
		round.Begin()
		round.Breaking = false
	else
		round.End()
		round.Breaking = true
	end
end

end
timer.Create(“round.Handle”, 1, 0, round.Handle)
//Friendly Fire

function GM:PlayerShouldTakeDamage( pl, victim )
if pl:IsPlayer() then
if pl:Team() == victim:Team() then
return false
end
end
return true
end

function GM:ShowSpare2( ply )
umsg.Start( “team_menu”, ply )
umsg.End()
end

hook.Add( “PlayerInitialSpawn”, “LoadVIP”, function( pl )
if ( pl:GetPData( “Rank” ) == nil ) then
pl:SetPData( “Rank”, 0 )
pl:SetNWInt( “Rank”, 0 )
else
pl:SetNWInt( “Rank” pl:GetPData( “Rank” ) )
end
end )

hook.Add( “PlayerDisconnected”, “SaveVIP”, function( pl )
pl:SaveVIP()
print( “Player disconnected: Now saving rank to server” )

end )
–Net Library Recieve–
net.Receive( ‘Team_Change’, function()
local red = Color( 255, 0, 0)
local wht = Color( 255, 255, 255 )
chat.AddText( red, "[CG] ", wht, net.Readstring()…’ and ', net.ReadFloat() )
end )[/lua]
But to no avail I still cannot get ti to work

Both, your shared.lua and sh_meta.lua have errors.


timer.Create( "Team", 10, 5, TeamT ) -- TeamT is undefined in shared.lua



function pl:GiveVIP()
	self:SetNWInt( "Rank", 1 )
	SaveVIP() -- No such function, cl_init.lua, you gotta use self:SaveVIP() or something.
end

function pl:TakeVIP()
	self:SetNWInt( "Rank", 0 )
	SaveVIP() -- No such function, cl_init.lua, you gotta use self:SaveVIP() or something.
end

I fixed that but i’m still getting the error
[lua]Couldn’t include file ‘shared.lua’ (File not found) (@gamemodes/teamdeathmatch/gamemode/cl_init.lua (line 1))
Couldn’t include file ‘sh_meta.lua’ (File not found) (@gamemodes/teamdeathmatch/gamemode/cl_init.lua (line 2))
[/lua]

Heres my new Shared.lua
[lua]GM.Name = “Team DeathMatch”
GM.Author = “VontaeGames”
GM.Email = “vontaegames@gmail.com
GM.Website = “N/A”

function GM:Initialize()

self.BaseClass.Initialize( self )

end
// Team for Free For All here

team.SetUp(1, “Federal”, Color(150, 0, 255))
team.SetUp(2, “Terrorists”, Color(255, 150, 0))

//Default Model setup for the teams
//Will need custom pointshop—Will be added later

util.PrecacheModel(“models/player/artic.mdl”)
util.PrecacheModel(“models/player/leet.mdl”)
util.PrecacheModel(“models/player/breen.mdl”)
util.PrecacheModel(“models/player/kleiner.mdl”)[/lua]

Heres the new meta.lua
[lua]local pl = FindMetaTable( “Player” )

function pl:IsVIP()
if( self:IsAdmin() or self:IsSuperAdmin() or self:GetNWInt( “Rank” ) == 1 ) then
return true
else
return false
end
end

function pl:SaveVIP()
self:SetPData( “Rank”, self:GetNWInt( “Rank” ) )
end

function pl:GiveVIP()
self:SaveVIP( “Rank”, 1 )
end

function pl:TakeVIP()
self:SaveVIP( “Rank”, 0 )
SaveVIP()
end[/lua]

Paste FULL console log after you start a game on your gamemode. Your init.lua looks like shit, it should be caused errors.

You still have the same error Robot told you to fix:

[lua]function pl:TakeVIP()
self:SaveVIP( “Rank”, 0 )
SaveVIP() -------------- this needs to be self:…
end[/lua]

You have to AddCSLuaFile shared.lua before cl_init