Jump to content

Editbox


Lloyd Logan

Recommended Posts

Posted

Why does this say there is no text in the editbox even if there is?

  
function checkRegField() 
    inputusernamereg = guiGetText(GUIEditor.edituserreg) 
    inputpasswordreg = guiGetText(GUIEditor.editpassreg) 
    if inputusernamereg or inputpasswordreg == "" then 
    guiSetVisible (GUIEditor.window[2], true ) 
     guiBringToFront ( GUIEditor.window[2] ) 
     else  
     triggerServerEvent("submitRegister", getRootElement(), inputusernamereg, inputpasswordreg) 
    end 
end 

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

Try this:

function checkRegField() 
    local inputusernamereg = guiGetText(GUIEditor.edituserreg) 
    local inputpasswordreg = guiGetText(GUIEditor.editpassreg) 
    if inputusernamereg:gsub ( " ", "" ) == "" or inputpasswordreg:gsub ( " ", "" ) == "" then 
        guiSetVisible (GUIEditor.window[2], true ) 
        guiBringToFront ( GUIEditor.window[2] ) 
    else 
        triggerServerEvent("submitRegister", localPlayer, inputusernamereg, inputpasswordreg) 
    end 
end 

Posted (edited)

It works! But, can you explain

gsub 

Edited by Guest

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

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...