Just debbuged. I realized that problem was with "ImportSettings" function @ ent_replace.lua
So I did that
local function ImportSettings(map)
if not ents.TTT.CanImportEntities(map) then return end
MsgN("test 1...")
local fname = "../maps/" .. map .. "_ttt.txt"
print(fname)
MsgN("test 2...")
local buf = file.Read(fname)
MsgN("test 3...")
local settings = {}
MsgN("test 4...")
print(buf)
local lines = string.Explode("\n", buf)
MsgN("test 5...")
for k, line in pairs(lines) do
if string.match(line, "^setting") then
local key, val = string.match(line, "^setting:\t(%w*) ([0-9]*)$")
val = tonumber(val)
if key and val then
settings[key] = val
else
ErrorNoHalt("Invalid line " .. k .. " in " .. fname .. "\n")
end
end
end
MsgN("RETURRRNNNN...")
return settings
end
The result is :
Weapon/ammo placement script found, attempting import...
Reading settings from script...
test 1...
../maps/cs_assault_ttt.txt
test 2...
test 3...
test 4...
nil
Timer Error: [@lua\includes\extensions\string.lua:34] bad argument #1 to 'string_gmatch' (string expected, got nil)
I'm not a lua pro, I have no idea about the cause of this. Please help me :<