So I am making a GUI-based script build with a TextBox and TextButton that runs the code when it's clicked. The main code is a LOCALScript under the ScreenGui there's a normal script with a StringValue as a child named "Source". The normal script is a child of the local script. ScreenGui -> LocalScript -> Normal script (So code doesn't run local) -> StringValue (Source)
And yes, the normal script IS disabled.
Also the LocalScript is named "sfunction", the ScreenGui "scripter" and the normal script is named "runcode".
LocalScript's code:
local runscript = script.runcode
local screen = script.Parent
local frame = screen.Frame
local run = frame.run
run.MouseButton1Click:connect(function()
local code = frame.tscript.Text
local newscript = runscript:Clone()
newscript.Parent = workspace
newscript.Source.Value = code
newscript.Disabled = false
end)
Normal script:
local source = script:WaitForChild("Source")
loadstring(source.Value)()
Output: 20:55:04.232 - An error occurred 20:55:04.233 - Script 'Players.Player1.PlayerGui.scripter.sfunction', Line 10 20:55:04.234 - stack end
Thank you

1 comment
Thanks Kenetec! I forgot about the Source property! Thanks again!