Quote:
Originally Posted by cbk1994
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";
x = player.x + 1;
y = player.y - 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.