Why does this script not print the answer of my value which contains an "equation"?
The value is a String Value , yes a String Value. Because it has to contain either " + " " - " "/ " or " * "
The String Value is currently set to "10 + 10" for test purposes.
When I click the calculate button, it should print** "20"** , right? Well... that's what it doesn't do. It prints "10 + 10" ... Why?
What can I do to make it print the answer of whatever is inside the "equation" ?
My coding is as follows:
local MainHolder = script.Parent:WaitForChild("MainHolder")
local Answer = MainHolder:WaitForChild("Equals"):WaitForChild("Answer")
local Buttons = MainHolder:WaitForChild("Buttons")
local Calculate = Buttons:WaitForChild("Calculate")
local Plus = Buttons:WaitForChild("Plus") --//All of these will be used later in my script
local Minus = Buttons:WaitForChild("Minus")
local Divide = Buttons:WaitForChild("Divide")
local Multiply = Buttons:WaitForChild("Multiply")
local Clear = Buttons:WaitForChild("Clear")
Calculate.MouseButton1Click:connect(function()
local Equation = MainHolder:WaitForChild("EquationToCalculate").Value --//Make sure the equation is actually the updated equation
--//The equation is currently set to "10+10" for test purposes
print(Equation) --//This just prints "10+10" instead of "20" , which should be the answer
end)
Any help is greatly appreciated!

2 comments
Don't use loadstring.
As i said, and i quote: "It shouldn't be used live, but if this is only for testing purposes, there's no problem."