Potato_Tomato420 Posted July 3, 2020 Share Posted July 3, 2020 (edited) 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 July 3, 2020 by Potato_Tomato420 Link to comment
Enargy, Posted July 3, 2020 Share Posted July 3, 2020 if (string.len(regUsernameBox:getText()) >= 3) then confirmMailPanel:setVisible(true) registerPanel:setVisible(false) else outputChatBox ("Your username most be longer then...") end Link to comment
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