• Server Not Loading a init.lua PLEASE HELP
    6 replies, posted
I recently started a Bhop server on Garrys Mod with the gamemode made by Ilya. Ive had a problem where i cannot add, change, remove any start or endings. I found that the .lua file (init.lua) couldnt load a script. Im not much of a coder so i need help. I will put the Error that comes up while the server is starting. [ERROR] lua/includes/extrensions/string.lua:44 bad argument #1 'string_gmatch' <string expected, got nil> 1. string_gmatch - [C]:-1 2. Explode - lua/includes/extensions/string.lua:44 3. CreateEningList - gamemodes/bhop/gamemode/sv_map_ending.lua:65 4. unknown - gamemodes/bhop/gamemode/sv_map_ending.lua:77 5. include - [C]:-1 6. unknown - gamemodes/bhop/gamemode/init.lua:17 [ERROR] lua/includes/extensions/string.lua:44 bad argument #1 to 'string_gmatch' <string expected, got nil> 1. string_gmatch - [C]:-1 2. Explode - lua/includes/extensions/string.lua:44 3. GetMapStart - gamemodes/bhop/gamemode/init.lua:298 4. unknown - gamemodes/bhop/gamemode/init.lua:334 Couldn't Load Init Script: 'bhop/gamemode/init.lua' [IMG]http://i.imgur.com/sjQqpzV.jpg[/IMG]
We cant help unless we see code (generally). Post init.lua line 17, 298 and 334 as well as sv_map_ending.lua line 77 and 65.
[QUOTE=G4MB!T;45607821]We cant help unless we see code (generally). Post init.lua line 17, 298 and 334 as well as sv_map_ending.lua line 77 and 65.[/QUOTE] init.lua [IMG]http://i.imgur.com/LSHxnf2.jpg[/IMG] [IMG]http://i.imgur.com/5jl4QqZ.jpg[/IMG] [IMG]http://i.imgur.com/WYMjvUY.jpg[/IMG] sv_map_ending.lua [IMG]http://i.imgur.com/P0OLV2g.jpg[/IMG] If there is anything else you need to let me know i really would like this problem fixed by this weekend :( . Im trying to help myself along the way but i only know so much :(
Your use of [URL="http://wiki.garrysmod.com/page/file/Read"]file.Read[/URL] is incorrect for CreateEndingList.
[QUOTE=G4MB!T;45610249]Your use of [URL="http://wiki.garrysmod.com/page/file/Read"]file.Read[/URL] is incorrect for CreateEndingList.[/QUOTE] Im not sure what that is i clicked it but i have no idea what im looking for. Can you please tell me what it should look like.? I know i need to do it myself but i honestly know really nothing about coding like this. :P What i think is going on is that since in the game i try and type those commands to add an end and stuff. It says unknown command. But since the lua wont load correctly it doesnt know those are commands and doesnt add them.
Line 64 of sv_map_end.lua should just be: [code] local ending_data = file.Read("map_ending.txt"); [/code] Also, make sure both files exist. [code] garrysmod/data/map_starting.txt garrysmod/data/map_ending.txt [/code]
[QUOTE=G4MB!T;45610433]Line 64 of sv_map_end.lua should just be: [code] local ending_data = file.Read("map_ending.txt"); [/code] Ok i dont get the errors (thank YOU) but i still cant add the start and endings? The console doesnt show they are commands? Also, make sure both files exist. [code] garrysmod/data/map_starting.txt garrysmod/data/map_ending.txt [/code][/QUOTE] [editline]6th August 2014[/editline] Ok THANK YOU SOOOOO MUCH!!!! :D It works you are my hero!!!
Sorry, you need to Log In to post a reply to this thread.