Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

how do you make a script builder run local scripts?

Asked by 6 years ago
Edited 6 years ago

i have been wanting help on this for a long time im trying to create a script builder and cant seem to know how i can make it on my game so it can run local scripts --My Attempt

01script.Parent.TextButton.MouseButton1Down:connect(function()
02local codetoexecute = script.Parent.TextBox.Text
03local scripttable = {}
04local function runInSandbox(f)
05    --get the old function environment
06    local oldenv = getfenv(f)
07 
08    --create a new one
09    local newenv = setmetatable({}, {
10        __index = function(_, k)
11            if k:lower() == 'game' or k:lower() == 'workspace' or k == 'Instance' then
12                --that prevents any instances being accessed
13                return nil
14            else
15                --but otherwise defaults to the old one
View all 31 lines...
0
`loadstring` can't be run on the client; please do some research. http://wiki.roblox.com/index.php?title=Global_namespace/Basic_functions#loadstring TheeDeathCaster 2368 — 6y

1 answer

Log in to vote
0
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
6 years ago

You cannot use loadstring() in LocalScripts.

What script builders do is they make an api on own web hosts which uploads a LocalScript with the specified source as a model to roblox using a dummy account, and then returns the model id which can be used with LoadAsset() or require() (if they make it a ModuleScript with a LocalScript parented to it).

0
It is also possible to make your own code compiler, which some admin models have done. mattscy 3725 — 6y
Ad

Answer this question