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.
COMMUNITY QUESTION
loadstring() not working?
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.

1 comment
Code please?