Azaroth Posted August 16, 2012 Posted August 16, 2012 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
Xeno Posted August 16, 2012 Posted August 16, 2012 Use tags. function MyPosition(button, state, absoluteX, absoluteY) if (button ~= "left") or (state ~= "up") then return end guiSetText ( gui["Otherl"], "text" ) end
Callum Posted August 17, 2012 Posted August 17, 2012 That example is somewhat pointless. Replace the ~= with == and put line 5 on line 3.
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