Jump to content

Check signs in guiCreateEdit


Recommended Posts

addEventHandler("onClientGUIChanged", (PASTE YOUR EDIT = VARIABLE), 
    local changedStr = (PASTE YOUR EDIT = VARIABLE):getText()
    local str = changedStr:gsub(" ","")
    if str ~= changedStr then
        (PASTE YOUR EDIT = VARIABLE):setText(str)

-- enable <oop>true</oop> in meta.xml

test it

Link to post

It is possible to make still so...

edit =  guiCreateEdit(x, y, width, heiht, "you text" ) --We set the name of a variable
str = string.gsub(guiGetText(edit), " ", "") --Get text and replace spaces
guiSetText(edit, str) --Let's replace with the ready text

P.S: string.gsub (<s>, <Search pattern>, <Replacement template>, [n])

  • S is a string.
  • Search pattern - what to search for or regular expression.
  • Replacement template - what to replace.
  • N - how many times can a replacement be made at most.
Link to post
function replaceText()
    local text = guiGetText(source)
    local replacedText = text:gsub("[^A-Za-z0-9%._@]", "")
    if text ~= replacedText then
        guiSetText(source, replacedText)

addEventHandler("onClientGUIChanged", login_edit, replaceText, false)


Link to post

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