View Single Post
  #5  
Old 06-02-2010, 11:06 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by cbk1994 View Post
All you do is make a text file and save it with a .gani extension. In the text file, it should look like this:

PHP Code:
SCRIPT
function onCreated()
{
  
doBlah();
}
SCRIPTEND 
It is just like any other script, but it is clientside. There is no need to have //#CLIENTSIDE, as it is always clientside.

You also cant use triggerserver to trigger the GANI to perform serverside functions.
You will want to put the variables (health, etc) that you want access to into player attributes (read this thread). Then, you can display them however you want.

PHP Code:
function onCreated() {
  
this.trigger("timeout"null);
}

function 
onPlayerEnters() {
  
this.trigger("created"null);
}

function 
onTimeOut() {
  
with (findimg(200)) {
    
image "myhealthbar.png";
    
    
player.1;
    
player.3;
    
    
attachtoowner true// follow player
    
temp.shouldBe = (50/100) * player.attr[5];
    
    if (
partW shouldBe) {
      
partW ++;
    } else if (
partW shouldBe) {
      
partW --;
    }
  }
  
this.setTimer(0.05);

This is a simple example of how you could make a health bar that "slides" from one HP to another instead of jumping (width decreases over time instead of immediately). You can also add particle effects or whatever in another showimg.
__________________
Reply With Quote