Jump to content

[Help] Substracting


brocky

Recommended Posts

I have a problem with a code, Its a simple calculator to substract numbers, but the problem is that it doesn't give the required/correct answer.

  
    editbox1 = guiCreateEdit(22, 41, 135, 24, "", false, window1) 
   editbox2 = guiCreateEdit(21, 80, 136, 24, "", false, window1) 
  buttonSub = guiCreateButton(148, 250, 110, 26, "Subtraction", false, window1) 
  
function substraction() 
     if buttonSub == source then 
           num1 = guiGetText ( editbox1 )  
           num2 = guiGetText ( editbox1 )  
  local   subtheAnswer = num1 - num2 
                  
       outputChatBox("Subtraction answer: "..subtheAnswer) 
              end 
     end 
addEventHandler("onClientGUIClick", buttonSub, substraction, false)   
  
  

Hope you understood

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...