Jump to content

Check signs in guiCreateEdit


Zcraks

Recommended Posts

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

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

test it

Link to comment

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