Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Getting an error with loadstring function. Don't know how to fix?

I am making a gear for script builder, where when you equip it, a GUI pops up where you can enter some lua code, and execute it. I tried using loadstring, and have LoadStringEnabled enabled. Here is my code:

script.Parent.MouseButton1Down : connect(function()
	loadstring("'" .. script.Parent.Parent.TextBox.Text .. "'")()
end)

Here is the error I am getting:

17:45:26.316 - Players.A_Ferret.PlayerGui.ScreenGui.TextButton.Script:2: attempt to call a nil value

1 answer

Why did you put the singles quotes? they will error every script you put in there

This discussion is preserved as it was. New answers, comments, and votes are closed.