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

"loadstring() is not available"?

Asked by 7 years ago

Hello there! I'm currently working on a script builder. The script builder works in studio, but not online. Whenever I test it online and look at the Roblox Developer Console, it says "loadstring is not available". Here is the script:

source = script.Parent.ScreenGui.Frame.ScrollingFrame.TextBox
local val = source.Value.Value
if source then
val = source.Text
local code = loadstring(val)
code()
print("Success!")
else
    print("Error while trying to load script")
end

It says the error is on line 5. Please help.

0
By the way, I have LoadStringEnabled in ServerScriptService, so it should work Cr_eepy 8 — 7y
0
loadstring is only available for *server* scripts (not LocalScripts), which is clearly documented on the Wiki. BlueTaslem 18071 — 7y

1 answer

Log in to vote
0
Answered by 5 years ago

Try this

source = script.Parent.ScreenGui.Frame.ScrollingFrame.TextBox
local val = source.IntValue.Value -- You cant name a Value "Value" that will give errors
if source then
val = source.Text
local code = loadstring(val)
code()
print("Success!")
else
    print("Error while trying to load script")
end
Ad

Answer this question