• [GMOD13] help with lua error
    10 replies, posted
Hello all, i am making a very simple game mode and i am using my "SRCDS" to test it but when i join it gives me this error [B]Client "*(ShAdOw_DrAgOn)*" connected (192.168.44.1:27006). [*(ShAdOw_DrAgOn)*|2|STEAM_0:0:35822882] Lua Error: Couldn't include file 'basicrp\gamemode\cl_init.lua' (File not found) (<nowhere>) [*(ShAdOw_DrAgOn)*|2|STEAM_0:0:35822882] Lua Error: [cpp] Couldn't Load Init Script: 'basicrp/gamemode/cl_init.lua' Dropped *(ShAdOw_DrAgOn)* from server (Kicked by Console : "Too many Lua Errors! Sorry!")[/B] And this is the code in my "init.lua, shared.lua and cl_init.lua" [B][U]cl_init.lua[/U][/B] [PHP]include( "shared.lua" ) function GM:Initialize() self.BaseClass.Initialize( self ) end[/PHP] [B][U]init.lua[/U][/B] [PHP]AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) include( 'shared.lua' ) include( "cl_init.lua" ) // Serverside only stuff goes here function GM:PlayerLoadout( pi ) pi:SetTeam( 3 ) pi:StripWeapons() pi:GodEnable() end function GM:PlayerSpawn( pi ) if pi:Team() == 1 then pi:Give("weapon_crowbar") pi:SetWalkSpeed( 700 ) pi:SetHealth( 300 ) pi:SetRunSpeed( 1000 ) pi:SetModel("models/player/zombiefast.mdl") end if pi:Team() == 2 then pi:Give("weapon_pistol") pi:Give("weapon_Ar2") pi:GiveAmmo(100, "pistol") pi:GiveAmmo(100, "Ar2") pi:SetModel("models/player/police.mdl") end if pi:Team() == 3 then pi:GodEnable() pi:SetHealth( 10000 ) end ///// end function BRP_START( pi ) pi:Kill() RND = math.random ( 1, 2 ) pi:SetTeam( RND ) end concommand.Add( "BRP_START", BRP_START )[/PHP] [B][U]shared.lua[/U][/B] [PHP]GM.Name = "BasicRP" GM.Author = "N/A" GM.Email = "N/A" GM.Website = "N/A" //DeriveGamemode( "base" ) function GM:Initialize() self.BaseClass.Initialize( self ) end //Teams team.SetUp( 1, "Beast", Color(102, 51, 0)) team.SetUp( 2, "Hunter", Color(102, 153, 0)) team.SetUp( 3, "Waiting", Color(102, 204, 255)) //models util.PrecacheModel("models/player/zombiefast.mdl") util.PrecacheModel("models/player/police.mdl")[/PHP] If you can help me that would be GREAT!, Thanks :)
[lua]AddCSLuaFile( "basicrp/gamemode/cl_init.lua" ) AddCSLuaFile( "basicrp/gamemode/shared.lua" ) include( 'basicrp/gamemode/shared.lua' ) -- include( "basicrp/gamemode/cl_init.lua" ) -- why on earth are you including cl_init serverside?[/lua] [lua]include( "basicrp/gamemode/shared.lua" )[/lua] Try that. Also if you want the server to stop kicking you for Lua errors, add "sv_kickerrornum 0" to server.cfg
Thanks i will try this right now i will tell you if it works [editline]29th August 2012[/editline] yeah ahh it still gives me the error that it cant find the cl_init.lua but it is in there
Do not be using cl_init serverside I hope you got that.
so do i just delete the cl_init and delete AddCSLuaFile( "basicrp/gamemode/cl_init.lua" ) ? [editline]29th August 2012[/editline] yeah some thing happens when i delete the cl_init [editline]29th August 2012[/editline] yeah same thing happens when i delete the cl_init
You want to remove include( "basicrp/gamemode/cl_init.lua" ) from your init.lua
Yeah.
yep iv done all that but still says the cl_init cant be found [editline]29th August 2012[/editline] Does anything need to be added to cl_init.lua cas so far i only got this [PHP]include( "shared.lua" ) function GM:Initialize() self.BaseClass.Initialize( self ) end[/PHP]
You should have [lua]AddCSLuaFile( "basicrp/gamemode/cl_init.lua" ) AddCSLuaFile( "basicrp/gamemode/shared.lua" ) include( 'basicrp/gamemode/shared.lua' )[/lua] at the top of init.lua and [lua]include( "basicrp/gamemode/shared.lua" )[/lua] at the top of cl_init.lua
yeah dont know why its not working i did that and it still gives me that error :( [editline]29th August 2012[/editline] any ideas? [editline]29th August 2012[/editline] Ok i have done a little re coding does the same thing but the codes a bit different but it still does not work on my SRCDS home server but when i try it in GMOD13 BETA when i put it in its gamemodes folder there are no errors and it works fine so can someone tell me why it keeps saying [B][U]cl_init.lua can not be found[/U][/B]
[QUOTE=mumbot;37453374]yeah dont know why its not working i did that and it still gives me that error :( [editline]29th August 2012[/editline] any ideas? [editline]29th August 2012[/editline] Ok i have done a little re coding does the same thing but the codes a bit different but it still does not work on my SRCDS home server but when i try it in GMOD13 BETA when i put it in its gamemodes folder there are no errors and it works fine so can someone tell me why it keeps saying [B][U]cl_init.lua can not be found[/U][/B][/QUOTE] Wait 'till GMOD13 is out, until then I personally would keep coding in GMOD12.
Sorry, you need to Log In to post a reply to this thread.