Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Gani script problem (https://forums.graalonline.com/forums/showthread.php?t=77102)

Crow 10-09-2007 07:19 PM

Gani script problem
 
Well, I got a problem. I got a script in a gani, which should change the color of something everytime you change the value (got a player.attr for red, green and blue). This is how the part with the script looks:

PHP Code:

SCRIPT
function onCreated() {
  
onTimeOut();
}
function 
onTimeout() {
  for (
temp.i=200;i<=203;i++) {
    
with (findimg(i)) {
      
red player.attr[20] / 255;
      
green player.attr[21] / 255;
      
blue player.attr[22] / 255;
    }
  }

  
setTimer(.05);
}
SCRIPTEND 

So it changes the colors of 4 sprites in the gani. Well, that does work, though you have to reconnect to see the changes. That didnt happen before, I got an extra gani just for that now, and when that stuff was still in the regular ones, it worked fine. So I tried something out, and found out that the timeout for some pretty weird reason will only run through once, and I have no idea why. So, I need some help here :]

DustyPorViva 10-09-2007 09:15 PM

function onPlayerenters()
I believe, instead on onCreated()

zokemon 10-09-2007 10:35 PM

Yes, use onPlayerenters() like Dusty said.

Crow 10-10-2007 02:51 PM

I will try that. Seems a little weird though, because it worked with onCreated() before.

Edit: Didnt work, its still not working properly :/

Edit2: The onPlayerEnters did fix it, just had some syntax error, hehe. Thanks alot :]


All times are GMT +2. The time now is 09:31 AM.

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