Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Endless loop... (https://forums.graalonline.com/forums/showthread.php?t=41045)

Googi 12-08-2002 12:33 PM

Endless loop...
 
NPC Code:

if (timeout&&this.loop=2){
if (this.key5=true){
this.hits+=1;
showimg 0,@@c@SUCCESSFUL,screenwidth/2,screenheight/1-10;
changeimgvis 0,4;
this.key1=false;
this.key2=false;
this.key3=false;
this.key4=false;
this.key5=false;
displaycraft();
sleep 2;
this.loop=1;
timeout=1;
}
else{
showimg 0,@@c@FAILED,screenwidth/2,screenheight/1-10;
changeimgvis 0,4;
this.key1=false;
this.key2=false;
this.key3=false;
this.key4=false;
this.key5=false;
displaycraft();
this.loop=1;
timeout=1;
}
}



For some reason, even though this.loop=1, the timeout still continues to execute the script :\.

Falcor 12-08-2002 01:27 PM

== instead of just the single = in the if conditions. = is an asignment statement, == is a comparison statement, dont get them mixed up.

Thats just looking at it at a glance, If there is anything else wrong though it would be in the body of the script.


All times are GMT +2. The time now is 10:44 PM.

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