Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Need help with something simple. (https://forums.graalonline.com/forums/showthread.php?t=134270389)

itsCyber 09-17-2016 06:32 PM

Need help with something simple.
 
So I know this may sound silly but how would I make the player chat bar come up when pressing the "ChatButton":confused:
NPC Code:
//#CLIENTSIDE
function onCreated() {
new GuiBitmapCtrl("ChatButton") {
profile = GuiDefaultProfile;
bitmap = "gui-button.png";
height = 57;
width = 63;
x = 27;
y = 171;
}
function ChatButton.onMouseDown() {

}
}


xXziroXx 09-17-2016 07:04 PM

First of all, I recommend using a GuiBitmapButtonCtrl over a GuiBitmapCtrl.

To make the chatbar show after clicking it, you'd just do:

PHP Code:

function ChatButton.onAction()
  
ChatBar.show(); 


callimuc 09-18-2016 08:15 AM

Quote:

Originally Posted by itsCyber (Post 1739922)
PHP Code:

//#CLIENTSIDE
function onCreated() {
  new 
GuiBitmapCtrl("ChatButton") {
    
profile GuiDefaultProfile;
    
bitmap "gui-button.png";
    
height 57;
    
width 63;
    
27;
    
171;
  }
  function 
ChatButton.onMouseDown() {

}



(added PHP tags to have it easier to read)

In addition to Ziro his suggestions, you should watch out where you set your brackets and where your functions are set. You can't call a function within a function (in this case), so it should look like:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  new 
GuiBitmapCtrl("ChatButton") {
    
profile GuiDefaultProfile;
    
bitmap "gui-button.png";
    
height 57;
    
width 63;
    
27;
    
171;
  }
}
function 
ChatButton.onMouseDown() {
  
//your actions




All times are GMT +2. The time now is 07:29 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.