• "glon" a nil value?!?
    6 replies, posted
Hi. I have been worked on a gamemode a while ago and i have started to work on it again. But now the glon.encode and glon.decode functions won't work? Here is a functions in which i use the function: [lua] function nameInUse(name) if(file.Exists("bennoRP/namesinuse.txt")) then local names = glon.decode(file.Read("bennoRP/namesinuse.txt")) if(table.HasValue(names, name)) then return true else return false end else local names = {} file.Write("bennoRP/namesinuse.txt", glon.encode(names)) return false end end [/lua] The error is: [code] BennoRP\gamemode\createchar.lua:55: attempt to index global 'glon' (a nil value) [/code] it is this line: [code] file.Write("bennoRP/namesinuse.txt", glon.encode(names)) [/code] Why doesn't it work anymore?
add [lua]require("glon")[/lua] at the top of the file. Ninja'd!
Weird, i didn't had to do that a few weeks ago. Thanks! :D
[QUOTE=Bennocs;19254639]Weird, i didn't had to do that a few weeks ago. Thanks! :D[/QUOTE] Sometimes you can make it work by using require("glon") in another script and it caries over. This shouldn't be relied on though :keke:
[QUOTE=Gbps;19254836]Sometimes you can make it work by using require("glon") in another script and it caries over. This shouldn't be relied on though :keke:[/QUOTE] That exact thing caught me out with a few scripts that relied on the datastream.
Sorry, you need to Log In to post a reply to this thread.