"glon" a nil value?!?

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:



BennoRP\gamemode\createchar.lua:55: attempt to index global 'glon' (a nil value)


it is this line:



file.Write("bennoRP/namesinuse.txt", glon.encode(names))


Why doesn’t it work anymore?

[lua]
require(“glon”)
[/lua]

Put that at the top of your file.

add [lua]require(“glon”)[/lua] at the top of the file.

Ninja’d!

:devil:

Weird, i didn’t had to do that a few weeks ago. Thanks! :smiley:

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:

That exact thing caught me out with a few scripts that relied on the datastream.