Oh, i always put ifcreated when i use those commands 
|
actually you don't need it. ifcreated runs the function (if) under the script only once, or when updated the level.
You can replace it as gs1 with if (playerenters) which renders the script each time the player enters. That'll be good if you are loading a different tileset.
You can also recall the function several times,
PHP Code:
if (playerenters || timeout) {
//scripthere ;
timeout = 1;
}
Which will loop the function every 1 second depending on the "timeout = time".
But still I recommend you guys to get hands on a server. What you're learning now isn't used much anymore.
---
Point is if you don't insert the if (created) will be okay. It will work even then.
Edit: btw guys , || means "or". you can do it this way too I suppose:
PHP Code:
if (created) {
timeout = 1;
}
if (timeout) {
//stuff here
timeout = 1;
}
You can find everything need in commands.rtf (small window you get in the level editor once you script an NPC on the right)
I don't have it right now, Linux doesn't support Graal correctly :/ , but that can help you :
&& means And, can be used as : if (created && 1+1 == 2) as an example
== means Define, usually used on the if's, if (1 + 1 == 2)
= means Equals, to make equals something, if (created) timeout = 1;
+ and - means + and - // you know what it means
+= and -= will add or reduce.
< and > means smaller and bigger, like if (1 < 2)
<= and >= means smaller or equals and bigger or equals, if (1 <= 1) //it will define as true
!= means Not Equals, if ( 1 != 2 ) // true statement
/ means division, if ( 2 / 1 == 2 ) // true again
* means times, if ( 3 * 3 == 9 ) //true again
pi means 3.14, used often in circles with cos and sin
strequals() means String Equals, read the next line as an example
# can be found in commands.rtf, fyi for the example I'm gonna use #c which is the chat, #g which is the guild. // also playerchats will read the players chat
PHP Code:
if (playerchats && strequals(#c,hi) && strequals(#g,Noobs For Life)) {
x +=1;
y = 30;
timeout = 0.05; //this will jump to the timeout in 0.05 seconds
}
if (timeout) {
for ( i = 5 ) { // for() is defining until the end of the brackets and i is a variable, you can call it anything
i += 1;
if ( i == 6 ) {
message hi;
sleep 1; //makes if wait 1 second before continuing
message hey;
}
}
timeout = 1; //redo the loop
}
Hope it helps guys, I'm not an expert but if any questions feel free to post (also any developers feel to correct me)