Jump to content

Count characters


Recommended Posts

Hi all, i'm currently script a login system for my server.

How can I prevent new players taking usernames that are only 1,2 or 3 characters long?

 

Spoiler

local regUsernameLabel = CustomLabel.create (10, 60, 100, 17, "Your username:", false, registerPanel)
regUsernameLabel:setAlign ("top", "left")
regUsernameLabel:setSystemFont ("clear-normal")
local regUsernameBox = CustomEdit.create(5, 75, 340, 30, "", false, registerPanel)
regUsernameBox:setMaxLength (20)


------------------------------------------------------------------------------------------


regCreateAccBtn:addEvent("onClientGUIClick", function()
	if not (regUsernameBox:getText() == "") then -- (???)
		confirmMailPanel:setVisible(true)
		registerPanel:setVisible(false)
--    else
--      	outputChatBox ("Your username most be longer then...")
	end
end)

 

 Thx!

Edited by Potato_Tomato420
Link to comment

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