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

loadstring() not working?

I am using loadstring() to calculate stuff in my calculator script. I have loadstring enabled in ServerScriptService but when I publish the place and join it it says loadstring not enabled/available.

1 comment

0

Code please?

1 answer

			local calculation = Display.Text
			local function calculate(calc)
   				local calculated = loadstring("return "..calculation)() -- <-------
    			return calculated
			end
			if string.sub(calculation, 1, 1) == "=" then
				calculation = string.sub(calculation, 2, string.len(calculation))
			end
			Display.LASTCALC.Text = calculation
			Display.Text = "="..calculate(calculation)

1 comment

0

You know you can edit your question right? By the way, Loadstring is disabled by default and is slowly heading toward deprecation. You can enable loadstring by going to ServerScriptService, and setting LoadStringEnabled to true.

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