Ok, after a bit of research I fixed the problem from above, but the new one is confusing.
All was good until my server was completely restarted. Now it does something really wierd.
Player_Time.txt:
"players"
{
"TestPlayer"
{
"time" 0
}
}
lua_run PrintTable(Player_Time_Table):
???^*#1:
TestPlayer:
time = 0Code that rights this table.
Player_Time_Table = (ULib.parseKeyValues( file.Read("Player_Times.txt")))
Msg("Table Created and set \n")verification table was set:
[ULIB] Loading module: Promotions.lua
Table Created and setOnly error reported:
ERROR: Hook 'PromotionInit_Hook' Failed: ULib/modules/Promotions.lua:13: attempt
to index field 'players' (a nil value)
Removing Hook 'PromotionInit_Hook'Function of the hook mentioned above:
function PromotionInit( ply )
ply.Last_Check = 0
if Player_Time_Table.players[ply:Nick()] == nil then
Player_Time_Table.players[ply:Nick()] = { time = 0 }
end
if !ply:IsAdmin() and !ply:IsSuperAdmin() then
if ply:IsUserGroup( "user" ) then
ply.promotionlvl = 0
else
if ply:IsUserGroup( "mod" ) then
ply.promotionlvl = 1
else
if ply:IsUserGroup( "respected" ) then
ply.promotionlvl = 2
else
if ply:IsUserGroup( "operator" ) then
ply.promotionlvl = 3
end
end
end
end
end
timer.Create(ply:Nick().. "Promotion_Timer", 1, 0, SetTime, ply)
end
hook.Add( "PlayerInitialSpawn", "PromotionInit_Hook", PromotionInit )
It's obvious why the hook is broken, but not the reason that the "players" changes to "

^*#1" this is the wierdest errors I've seen so far. Any suggestions/idea on how to fix or as to why this is happening?
==EDIT==
Got this error on client:
Client side error:
[code]
ULib/_cl_2.20/misc.lua:38: bad argument #1 to 'gsub' (string expected, got nil)
[/code]
Line 38 from the error above:
str = string.gsub( str, ULib.makePatternSafe( comment ) .. "[%S \t]*", "" )