You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? I want to make a working Calculator
-
What is the issue? The Cacualtor does not return the add function and add the numbers the user inputs
-
What solutions have you tried so far? I have tried alot of troubleshooting like debugging watching a yt tutorial but none of that worked
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local PlayerGui = game.Players.LocalPlayer.PlayerGui
local CaculatorNumberscool = PlayerGui.Caculator.CaculatorButtons
local CaculatorDisplay = PlayerGui.Caculator.CaculatorDisplay
local CaculatorSigns = PlayerGui.Caculator.CaculatorArthmitic
for i,CaculatorNumbers in pairs(CaculatorNumberscool:GetChildren()) do
CaculatorNumbers.MouseButton1Click:Connect(function()
print(CaculatorNumbers)
CaculatorDisplay.CaculatorText.Text = CaculatorNumbers.Text
if CaculatorNumbers then
local Numbers = 1
print("Please insert a sign")
for i,Signs in pairs(CaculatorSigns:GetChildren()) do
Signs.MouseButton1Click:Connect(function()
if CaculatorNumbers and Signs then
print("Please insert another number")
CaculatorDisplay.CaculatorText.Text = Signs.Text and CaculatorDisplay.CaculatorText.Text
CaculatorNumbers.MouseButton1Click:Connect(function()
if Numbers == 2 then
local function Add(a,b)
return a+b
end
local Addresult = Add(CaculatorNumbers,CaculatorNumbers)
CaculatorDisplay.CaculatorText.Text = Addresult.Text
end
end)
end
Hello I’m trying to script a calculator Gui but the problem is that it is not working or adding up the two numbers together why is this happening thanks for your help.