Jump to content

Solved.


MajdMTA

Recommended Posts

Posted

Simply, just check if the editbox is not empty that's mean it has some characters onto it.

Try that and tell me the result.

function nameLabel() 
    local text = guiGetText(GUIEditor.edit[1])  
    if (text ~= "") then 
        guiSetText(GUIEditor.label[2], "Available name!") 
    end 
end 

Good luck.

Posted
Simply, just check if the editbox is not empty that's mean it has some characters onto it.

Try that and tell me the result.

function nameLabel() 
    local text = guiGetText(GUIEditor.edit[1])  
    if (text ~= "") then 
        guiSetText(GUIEditor.label[2], "Available name!") 
    end 
end 

Good luck.

It's didn't work, I tried debugscript, No errors.

Posted
  
username = guiCreateEdit(13, 316, 223, 33, "", false, regWindow) 
nameLabel = guiCreateLabel(292, 42, 115, 25, "Enter a name", false, regWindow) 
guiSetFont(nameLabel, "clear-normal") 
guiLabelSetColor(nameLabel, 247, 0, 0) 
  
function nameLabel() 
    local text = guiGetText(username) 
    if (text ~= "") then 
        guiSetText(nameLabel, "Available name!") 
    end 
end 

Posted

Here you go,

local registerBut = guiCreateButton( 298, 570, 127, 42, "Create my account", false, regWnd) 
local username = guiCreateEdit(13, 316, 223, 33, "", false, regWindow) 
local nameLabel = guiCreateLabel(292, 42, 115, 25, "Enter a name", false, regWindow) 
guiSetFont(nameLabel, "clear-normal") 
guiLabelSetColor(nameLabel, 247, 0, 0) 
  
addEventHandler("onClientGUIClick", guiRoot,   
function () 
    if (source == registerBut) then 
        local text = guiGetText(username) 
        if (text ~= "") then 
            guiSetText(nameLabel, "Available name!") 
        end 
    end 
end) 

Posted
Here you go,
local registerBut = guiCreateButton( 298, 570, 127, 42, "Create my account", false, regWnd) 
local username = guiCreateEdit(13, 316, 223, 33, "", false, regWindow) 
local nameLabel = guiCreateLabel(292, 42, 115, 25, "Enter a name", false, regWindow) 
guiSetFont(nameLabel, "clear-normal") 
guiLabelSetColor(nameLabel, 247, 0, 0) 
  
addEventHandler("onClientGUIClick", guiRoot,   
function () 
    if (source == registerBut) then 
        local text = guiGetText(username) 
        if (text ~= "") then 
            guiSetText(nameLabel, "Available name!") 
        end 
    end 
end) 

It's worked........... but i need it if he fill the edit not if he click on "register button" ...

Posted

Try that,

[lua]local registerBut = guiCreateButton( 298, 570, 127, 42, "Create my account", false, regWnd) 
local username = guiCreateEdit(13, 316, 223, 33, "", false, regWindow) 
local nameLabel = guiCreateLabel(292, 42, 115, 25, "Enter a name", false, regWindow) 
guiSetFont(nameLabel, "clear-normal") 
guiLabelSetColor(nameLabel, 247, 0, 0) 
  
addEventHandler("onClientGUIChanged", guiRoot,   
function () 
    local text = guiGetText(username) 
    if (text ~= "") then 
        guiSetText(nameLabel, "Available name!") 
    end 
end) 

[/lua]

Posted

Try that,

local registerBut = guiCreateButton( 298, 570, 127, 42, "Create my account", false, regWnd) 
local username = guiCreateEdit(13, 316, 223, 33, "", false, regWindow) 
local nameLabel = guiCreateLabel(292, 42, 115, 25, "Enter a name", false, regWindow) 
guiSetFont(nameLabel, "clear-normal") 
guiLabelSetColor(nameLabel, 247, 0, 0) 
  
addEventHandler("onClientGUIChanged", guiRoot,   
function () 
    local text = guiGetText(username) 
    if (text ~= "") then 
        guiSetText(nameLabel, "Available name!") 
    end 
end) 

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