FSXTim Posted June 8, 2012 Share Posted June 8, 2012 Hello, I have a small problem with my script. function ergebnisGet (state) if state == "left" then if(source == cGleich) then local value1 = guiGetText(eingabe1) local value2 = guiGetText(eingabe2) local result = guiGetText(zwischeneingabe) if result == "+" then guiSetText(ergebnis,tonumber(value1)+tonumber(value2)) end if result == "x" then guiSetText(ergebnis,tonumber(value1)*tonumber(value2)) end end end end addEventHandler("onClientGUIClick", getRootElement(), ergebnisGet) The calculation with + works, but the calculation with * doesn't work. Why? Greets Link to comment
FSXTim Posted June 8, 2012 Author Share Posted June 8, 2012 I know, but it doesn't. Greets Link to comment
UAEpro Posted June 8, 2012 Share Posted June 8, 2012 strange ... try function ergebnisGet (state) if state == "left" then if(source == cGleich) then local value1 = guiGetText(eingabe1) local value2 = guiGetText(eingabe2) local result = guiGetText(zwischeneingabe) if result == "+" then guiSetText(ergebnis,tonumber(value1)+tonumber(value2)) elseif result == "x" then guiSetText(ergebnis,tonumber(value1)*tonumber(value2)) end end end end addEventHandler("onClientGUIClick", getRootElement(), ergebnisGet) Link to comment
FSXTim Posted June 8, 2012 Author Share Posted June 8, 2012 Thanks, that's working. Greets Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now