Hello Community,
This loadstring module is from the Adonis module but I don’t know how to use it for execute a loadstring. If you could help me it would be very cool, because I need that for my script who I take it from my webspace. Thansk for every awnser!
local waitDeps = {
'Rerubi';
'LuaK';
'LuaP';
'LuaU';
'LuaX';
'LuaY';
'LuaZ';
}
for i,v in pairs(waitDeps) do script:WaitForChild(v) end
local luaX = require(script.LuaX)
local luaY = require(script.LuaY)
local luaZ = require(script.LuaZ)
local luaU = require(script.LuaU)
local rerubi = require(script.Rerubi)
luaX:init()
local LuaState = {}
getfenv().script = nil
return function(str,env)
local f,writer,buff,name
local env = env or getfenv(2)
local name = (env.script and env.script:GetFullName())
local ran,error = pcall(function()
local zio = luaZ:init(luaZ:make_getS(str), nil)
if not zio then return error() end
local func = luaY:parser(LuaState, zio, nil, name or "::Adonis::Loadstring::")
writer, buff = luaU:make_setS()
luaU:dump(LuaState, func, writer, buff)
f = rerubi(buff.data, env)
end)
if ran then
return f,buff.data
else
return nil,error
end
end
Without these it won’t work anyway. Those modules can be found in the script you’ve provided.
Roblox also provides built-in loadstring however the Adonis module allows for a bypass to the game owner manually enabling loadstring execution.
I assume the script you have provided is a Module. That will require a Client Script or a Server Script to require the module and execute the function with the code that needs to be ran.
You should try to get a standalone “custom loadstring” module, because modules from a bigger project expect the existance of other modules/assets/scripts
local LoadString = require(script.Bytecode)
GetRandom = function(Len)
local Length = (type(Len) == "number" and Len) or math.random(5,10)
local Result = {}
for Number = 1, Length do
Result[Number] = string.format('%02x', math.random(126));
end
return table.concat(Result)
end
_G.Functions = {}
local Module = {}
function Module:Execute(Type, String)
if not (Type and String) then
return
end
local func = LoadString(String)
local execid = GetRandom()
local Base
if Type == "Script" then
Base = script.ScriptBase:Clone()
local Value = Instance.new("StringValue", Base)
Value.Name = "Execute"
Value.Value = execid
_G.Functions[execid] = func
else
Base = script.LocalScriptBase:Clone()
local Value = Instance.new("StringValue", Base)
Value.Name = "Execute"
Value.Value = execid
_G.Functions[execid] = func
end
return Base
end
return Module;
I now did this script but the script won’t execute in the Door module to operate it.
local load = require(script.Loadstring)
local HttpService = game:GetService("HttpService")
local URL_ASTROS = "https://private-scripts.glitch.me/Sensor_Door.lua"
local response = HttpService:GetAsync(URL_ASTROS)
load:Execute("Script",response)
There’s no way to know what’s wrong with it because the code is stored in a remote server, please do this print(response) and then check the output. Give us the output so we can figure out the error. Thanks.
Can I not execute the script via a loadstring? I would secure my code by this way and execute it with a loadstring. The script shoult get by a http request and the execute it as a script. I’m new in this theme.
The only way to “loadstring” is by using the built-in function loadstring(argstring), although it is possible to create a custom loadstring function (That’s hard though) a http request won’t help at all.
local HttpService = game:GetService("HttpService")
local URL_ASTROS = "https://private-scripts.glitch.me/Sensor_Door.lua"
local response = HttpService:GetAsync(URL_ASTROS)
loadstring(response)