Jump to content

[Problem] guiSetText


Azaroth

Recommended Posts

Hello.

I have problem with guiSetText. It didn't want to change text of label. I want to change it on button click.

Label:

    gui["Otherl"] = guiCreateLabel(10, 225, 50, 15, "Other:", false, gui["_root"]) 
    guiLabelSetHorizontalAlign(gui["Otherl"], "left", false) 
    guiLabelSetVerticalAlign(gui["Otherl"], "center") 

Button:

    gui["MyPos"] = guiCreateButton(300, 45, 70, 20, "MyPos", false, gui["_root"]) 
    if on_MyPos_clicked then 
        addEventHandler("onClientGUIClick", gui["MyPos"], MyPosition, false) 
    end  

Function:

function on_MyPos_clicked(button, state, absoluteX, absoluteY) 
    if (button ~= "left") or (state ~= "up") then 
        return 
    end 
    guiSetText ( gui["Otherl"], "text" ) 
     
end 

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