Mittell Buurman Posted August 12, 2013 Posted August 12, 2013 It's very simple. Once you press the button, it must check if the number is between 1 and 5 and if it is, it changes the value up or down. But when I press the button and I have reached 5, it still adds 1. charname = guiGetText(edtchar) str=guiGetText(strskl) def=guiGetText(defskl) int=guiGetText(intskl) sta=guiGetText(staskl) han=guiGetText(hanskl) inv=guiGetText(invskl) wep=guiGetText(wepskl) res=guiGetText(resskl) local total = tonumber(str+def+int+sta+han+inv+wep+res) if (source==btnstrm) then if ((tonumber(str)>0) or (tonumber(str)<6)) then guiSetText(strskl, tonumber(str-1)) outputChatBox(str) end elseif (source==btnstrp) then if (tonumber(str)>0 or tonumber(str)<6) then guiSetText(strskl, tonumber(str+1)) end elseif (source==btndefm) then if (tonumber(def)>0 or tonumber(def)<6) then guiSetText(defskl, tonumber(def-1)) end elseif (source==btndefp) then if (tonumber(def)>0 or tonumber(def)<6) then guiSetText(defskl, tonumber(def+1)) end elseif (source==btnintm) then if (tonumber(int)>0 or tonumber(int)<6) then guiSetText(intskl, tonumber(int-1)) end elseif (source==btnintp) then if (tonumber(int)>0 or tonumber(int)<6) then guiSetText(intskl, tonumber(int+1)) end elseif (source==btnstam) then if (tonumber(sta)>0 or tonumber(sta)<6) then guiSetText(staskl, tonumber(sta-1)) end elseif (source==btnstap) then if (tonumber(sta)>0 or tonumber(sta)<6) then guiSetText(staskl, tonumber(sta+1)) end elseif (source==btnhanm) then if (tonumber(han)>0 or tonumber(han)<6) then guiSetText(hanskl, tonumber(han-1)) end elseif (source==btnhanp) then if (tonumber(han)>0 or tonumber(han)<6) then guiSetText(hanskl, tonumber(han+1)) end elseif (source==btninvm) then if (tonumber(inv)>0 or tonumber(inv)<6) then guiSetText(invskl, tonumber(inv-1)) end elseif (source==btninvp) then if (tonumber(inv)>0 or tonumber(inv)<6) then guiSetText(invskl, tonumber(inv+1)) end elseif (source==btnwepm) then if (tonumber(wep)>0 or tonumber(wep)<6) then guiSetText(wepskl, tonumber(wep-1)) end elseif (source==btnwepp) then if (tonumber(wep)>0 or tonumber(wep)<6) then guiSetText(wepskl, tonumber(wep+1)) end elseif (source==btnresm) then if (tonumber(res)>0 or tonumber(res)<6) then guiSetText(resskl, tonumber(res-1)) end elseif (source==btnresp) then if (tonumber(res)>0 or tonumber(res)<6) then guiSetText(resskl, tonumber(res+1)) end end
Mittell Buurman Posted August 12, 2013 Author Posted August 12, 2013 How could I have missed it....lol
Mittell Buurman Posted August 12, 2013 Author Posted August 12, 2013 Nevermind, Looking at the code now it's actually useless..
tosfera Posted August 12, 2013 Posted August 12, 2013 Nevermind, Looking at the code now it's actually useless.. hahaha those feelings are the worst. Look what I made it,,, is useless. If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Moderators IIYAMA Posted August 12, 2013 Moderators Posted August 12, 2013 tables, learn it or write double/triple/////// lines. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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