So, I started creating a zombie survival server. Everything is ok, until I enter on the server. Nothing is happening. When I pressed F8, there was an error.
Here’s the script:
Root = {}
Modules = {}
local Categories = {“Core”, “Base”, “User”}
local Fxmanifest = {“Shared”, “Client”, “Server”}
for i in pairs(Categories) do
local File = GetDataFile(“Modules/” … Categories[i] … “/Modules.json”)
local JSONData = json.decode(File)
table.insert(Modules, Categories[i])
Modules[i] = {}
for j in pairs(JSONData) do
print("^1[ZO] ^5["… JSONData[j] …"] Loaded^7")
table.insert(Modules[i], JSONData[j])
Modules[i][j] = {}
Modules[i][j][“Path”] = “Modules/” … Categories[i] … “/” … JSONData[j] … “/”
Modules[i][j][“Category”] = Categories[i]
Modules[i][j][“Name”] = JSONData[j]
Modules[i][j][“CodeSide”] = {}
for k in pairs(Fxmanifest) do
Modules[i][j][“CodeSide”][Fxmanifest[k]] = {}
local EventsCode = GetDataFile(“Modules/” … Categories[i] … “/” … JSONData[j] … “/”… Fxmanifest[k] …"/Events.lua")
local MainCode = GetDataFile(“Modules/” … Categories[i] … “/” … JSONData[j] … “/”… Fxmanifest[k] …"/Main.lua")
Modules[i][j][“CodeSide”][Fxmanifest[k]][“Events”] = EventsCode
Modules[i][j][“CodeSide”][Fxmanifest[k]][“Main”] = MainCode
end
end
end
LoadModules(“Shared”)
D4NE
June 13, 2021, 11:09am
2
could you please reply the code in code tags? --
Root = {}
Modules = {}
local Categories = {"Core", "Base", "User"}
local Fxmanifest = {"Shared", "Client", "Server"}
for i in pairs(Categories) do
local File = GetDataFile("Modules/" .. Categories[i] .. "/Modules.json")
local JSONData = json.decode(File)
table.insert(Modules, Categories[i])
Modules[i] = {}
for j in pairs(JSONData) do
print("^1[ZO] ^5[".. JSONData[j] .."] Loaded^7")
table.insert(Modules[i], JSONData[j])
Modules[i][j] = {}
Modules[i][j]["Path"] = "Modules/" .. Categories[i] .. "/" .. JSONData[j] .. "/"
Modules[i][j]["Category"] = Categories[i]
Modules[i][j]["Name"] = JSONData[j]
Modules[i][j]["CodeSide"] = {}
for k in pairs(Fxmanifest) do
Modules[i][j]["CodeSide"][Fxmanifest[k]] = {}
local EventsCode = GetDataFile("Modules/" .. Categories[i] .. "/" .. JSONData[j] .. "/".. Fxmanifest[k] .."/Events.lua")
local MainCode = GetDataFile("Modules/" .. Categories[i] .. "/" .. JSONData[j] .. "/".. Fxmanifest[k] .."/Main.lua")
Modules[i][j]["CodeSide"][Fxmanifest[k]]["Events"] = EventsCode
Modules[i][j]["CodeSide"][Fxmanifest[k]]["Main"] = MainCode
end
end
end
LoadModules("Shared")
D4NE
June 13, 2021, 11:14am
5
could you please share the Modules.Json and make sure that the file is readable from the lua?
D4NE
June 13, 2021, 11:16am
7
And please share the modules.json too.
it’s only the script. Sorry if i don’t understand, I’m new to scripting
Main.lua (1.2 KB)
It’s only this, that’s what the error said
there are 3 type of modules. The Core, Base and User. Which one?
D4NE
June 13, 2021, 11:23am
11
okay, so theres something bad in argument. i could be the file that contains bad lines, or the file that even cant the file cant be found.
all of them please
The Base:
Modules.json (8 Bytes)
The Core:
Modules.json (146 Bytes)
The User:
Modules.json (17 Bytes)
D4NE
June 13, 2021, 11:55am
15
Yeah, no it makes no sense tio me why u shouldnt workj