Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-17-2016, 06:32 PM
itsCyber itsCyber is offline
A sexy Scotsman
itsCyber's Avatar
Join Date: Sep 2016
Location: Somewhere in Sunny Scotland
Posts: 11
itsCyber is on a distinguished road
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"
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() {

}
}

__________________
Graalians are friends. Not Food
~FindingStefan
Reply With Quote
  #2  
Old 09-17-2016, 07:04 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
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(); 
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #3  
Old 09-18-2016, 08:15 AM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by itsCyber View Post
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

__________________
MEEP!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:28 PM.


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