Stranger Posted October 26, 2013 Posted October 26, 2013 hello guys i have a little problem in this code : timeee[localPlayer] = setTimer(function () local gWA22 = guiGetText (GUIEditor_Edit[1]) if gWA22 == '-' then guiSetText (GUIEditor_Edit[1],"") end local gWA22 = guiGetText (GUIEditor_Edit[2]) if gWA22 == '-' then guiSetText (GUIEditor_Edit[2],"") end local gWA22 = guiGetText (GUIEditor_Edit[3]) if gWA22 == '-' then guiSetText (GUIEditor_Edit[3],"") end local gWA22 = guiGetText (GUIEditor_Edit[4]) if gWA22 == '-' then guiSetText (GUIEditor_Edit[4],"") end local gWA22 = guiGetText (GUIEditor_Edit[5]) if gWA22 == '-' then guiSetText (GUIEditor_Edit[5],"") end local gWA22 = guiGetText (GUIEditor_Edit[6]) if gWA22 == '-' then guiSetText (GUIEditor_Edit[6],"") end local gWA22 = guiGetText (GUIEditor_Edit[7]) if gWA22 == '-' then guiSetText (GUIEditor_Edit[7],"") end local gWA22 = guiGetText (GUIEditor_Edit[8]) if gWA22 == '-' then guiSetText (GUIEditor_Edit[8],"") end local gWA22 = guiGetText (GUIEditor_Edit[9]) if gWA22 == '-' then guiSetText (GUIEditor_Edit[9],"") end local gWA22 = guiGetText (GUIEditor_Edit[10]) if gWA22 == '-' then guiSetText (GUIEditor_Edit[10],"") end local gWA22 = guiGetText (GUIEditor_Edit[11]) if gWA22 == '-' then guiSetText (GUIEditor_Edit[11],"") end local gWA22 = guiGetText (GUIEditor_Edit[12]) if gWA22 == '-' then guiSetText (GUIEditor_Edit[12],"") end local gWA22 = guiGetText (GUIEditor_Edit[13]) if gWA22 == '-' then guiSetText (GUIEditor_Edit[13],"") end local gWA22 = guiGetText (GUIEditor_Edit[14]) if gWA22 == '-' or gWA22 == '1-' then guiSetText (GUIEditor_Edit[14],"") end local gWA22 = guiGetText (GUIEditor_Edit[15]) if gWA22 == '-' then guiSetText (GUIEditor_Edit[15],"") end end, 50, 0 ) it work fin but when i wrote "-" return to " " and this is good, but there is a problem : when i wroted like that "11-11" and remove 11 like this "-11" the "-" should be removed, but no and i want it like this : i can't wrote any thing only 'noumber' and i want it when i wroted like this "11-" return to " " help please and thank you .
iPrestege Posted October 26, 2013 Posted October 26, 2013 (edited) addEventHandler('onClientGUIChanged',root, function ( Element ) for k = 1,15 do if source == GUIEditor_Edit[k] then if not tonumber ( guiGetText ( source ) ) then return guiSetText ( source,'' ) end end end end ) I guess this is what you want. Edited October 26, 2013 by Guest
Stranger Posted October 26, 2013 Author Posted October 26, 2013 there is another problem, when i copy this "-55" or " gg" i can past it in the edit, i don't want it like this, is there anyway, to fix it ? i want it when i copy this "-1" and past it then return to "1" do you know what i mean ? i mean if i past it, if there any "-" or "abc" then remove it and leave the number after the "-" help please .
Stranger Posted October 26, 2013 Author Posted October 26, 2013 (edited) no you don't understand me i mean i wan't when some one copy this "-1" and past it in the edit, the "-" remove and leave "1" Edited October 26, 2013 by Guest
فاّرس Posted October 26, 2013 Posted October 26, 2013 Yes,i know. Use math.abs. Ex : addCommandHandler('change',function() local text = guiGetText(edit) if text:find('-') then guiSetText(edit,math.abs(text)) end end )
Stranger Posted October 26, 2013 Author Posted October 26, 2013 can you tell me what is wrong in this code : addEventHandler('onClientGUIChanged',root, for k = 1,15 do if source == GUIEditor_Edit[k] then local text = guiGetText(GUIEditor_Edit[k]) if text:find('-') then guiSetText(GUIEditor_Edit[k],math.abs(text)) end end end end )
Stranger Posted October 26, 2013 Author Posted October 26, 2013 sorry ----------- Edit # thank you so much
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