of     1   

lexielane
#221334454Friday, July 14, 2017 9:41 PM GMT

Trying to have the last element of the table and if it's the last element change it to 0. Trying to minus by the length of the table, so that it removes the last element. bad argument #1 to 'remove' (table expected, got number) I'm guessing where i'm going wrong is I am converting the table to a number when pressing the keypad? local Self = TradeGui.Frame.Frame.Self; local selfPtsWorth = TradeGui.Frame.Frame.SelfWorth.PointsWorth; local Foe = TradeGui.Frame.Frame.Opponent; local foePtsWorth = TradeGui.Frame.Frame.OpponentWorth.PointsWorth; local selfSavedNum = {}; local foeSavedNum = {}; function Calculator(User, po############a######### for Index, Value in next, User:GetChildren() do Value.MouseButton1Click:connect(function() if Value.Name == "Back" then local numLength = string.len(savedNum); table.remove(savedNum, numLength); pointsWorth.Text = (pointsWorth.Text .. savedNum); elseif Value.Name == "Enter" then print('pressed enter'); elseif tonumber(Value.Text) == "0" or tonumber(Value.Text) == 1 or tonumber(Value.Text) == 2 or tonumber(Value.Text) == 3 or tonumber(Value.Text) == 4 or tonumber(Value.Text) == 5 or tonumber(Value.Text) == 6 or tonumber(Value.Text) == 7 or tonumber(Value.Text) == 8 or tonumber(Value.Text) == 9 then savedNum = tonumber(Value.Text); pointsWorth.Text = (pointsWorth.Text .. savedNum); end; end); end; end; Calculator(Self, selfPtsWorth, selfSavedNum); Calculator(Foe, foePtsWorth, foeSavedNum);
LeafDoode
#221335214Friday, July 14, 2017 9:51 PM GMT

local textBox1 = script.Paret.TextBox1 local textBox2 = script.Parent.TextBox2 function add(num1,num2) return num1 + num2 end button.MouseButton1Click:connect(function() add(textBox1,textBox2) end)
lexielane
#221335638Friday, July 14, 2017 9:56 PM GMT

Adding the numbers works fine. What I want to do is get rid of the last number in the table when the back button is pressed.
lexielane
#221344680Friday, July 14, 2017 11:02 PM GMT

Thanks.

    of     1