So I was wondering how I could get past this error that is encountered when trying to add “1” to the end of a string in a TextBox to simulate a calculator. Here is my current LocalScript for the 1 button:
local contents = game.StarterGui.ScreenGui.Calculator.TextBox.Text
local button = script.Parent
function Clicked (mouse)
contents=contents+"1"
end
button.MouseButton1Click:Connect(Clicked)
And here’s the error:
Players.Derpee_Kirbee.PlayerGui.ScreenGui.Calculator.1.LocalScript:5: attempt to perform arithmetic (add) on string