Remember that the load()
function don't run the Lua code, it just parse it and generate bytecode as a Lua function.
So you need to call the result of the load()
function.
local client = net.Http("https://raw.githubusercontent.com")
local Center1 = client:get("/Dezeroller/test/main/keys.txt")
--- Here you need to call the generated function using parenthesis, the result will be stored in table1
local table1 = load(Center1)()
local entryName = ui.Entry(win, "Enter Name", 110, 80)
local button = ui.Label(win, "Ok", 110, 152)
function button:onClick()
if table1[entryName.text] then
print("Active")
end
end
Secondly, you should not make the table local
in the script file, because it will be local to the generated function.
You should return it like this :
-- the return table will be stored in the table1 variable form the load() call
return {
["Hey"] = {Key = "BubbleGum", blocked = false}
}