Can't you just join the object to a class?
Class guifunctions:
PHP Code:
//#CLIENTSIDE
function changetext(newtext) {
this.text = temp.newtext;
player.chat = "Changed text to " @ temp.newtext;
}
Weapon GUI:
PHP Code:
//#CLIENTSIDE
function onCreated() {
new GuiButtonCtrl("MyButton") {
this.join("guifunctions");
this.profile = GuiButtonProfile;
this.text = "Some text";
}
}
function MyButton.onAction() {
MyButton.changetext("Other text");
}
I haven't tested this specific one myself, but Inverness' GUI fading works this way; you join the window GUI to a class, and use MyWindow.fadein(), etc.
Though this is probably going to be considered a work-around, I find it more organized.