New to Lua

Hello, I am new to Lua but I’ve been browsing FP for a long time before I became a member. As I said I am new to Lua and I am just experimenting, making a HUD and so on just to learn abit more, I havnt gotten my Gamemode to work. It says “Cant open (GameMode Name)” And then its only normal sandbox(Its for Garrys Mod) Its cl_init.lua or init.lua that cant open(I dont got the time to read before it closes the small box in the corner down) , Ive followed some guides and I have done the same as them just to learn basic codes, cant seem to get it to work.


(User was banned for this post ("Wrong section" - mahalis))

You almost certainly introduced some syntax errors in your code. When launching your gamemode look trough the console (all of it) for any lua errors that could be related to your scripts. When you do find them please post them here along with the relevant file so we can help you find the error(s).

Lua initialized (Lua 5.1)
TrainingMod/gamemode/init.lua:34: ‘end’ expected (to close ‘function’ at line 14) near ‘<eof>’



********** COULDN’T LOAD GAMEMODE!! **********



There was a problem opening the gamemode file 'TrainingMod/gamemode/init.lua

Lua initialized (Lua 5.1)
ScriptEnforce: “trainingmod\gamemode\cl_init.lua” blocked
Registering gamemode ‘TrainingMod’ derived from ‘base’
Sending 8 ‘User Info’ ConVars to server (cl_spewuserinfoconvars to see)
VAC secure mode is activated.
Redownloading all lightmaps

I don’t know lua, but isn’t it obvious you’re supposed to look the file trainingmod/gamemode/init.lua, line 14? Again, I don’t know lua, but I think have to place a ‘}’ there

You are missing an end to close the function that you started on line 14.

Followed a guide exactly :o Ill check it out and see if i can fidn the solution on Line14

[editline]01:00PM[/editline]

Ah! Yes i missed the end

[editline]01:00PM[/editline]

Thanks very much :slight_smile: