Quote:
Originally Posted by theHAWKER
Im making a boat system, but my script wont work can someone help me out:
PHP Code:
// NPC made by Join my guild Elite Mafia!
//#CLIENTSIDE
if (created) {
time = 10;
}
if (playerenters) {
time = 10;
timeout = .1;
}
if (timeout) {
time -= 1;
timeout = 2;
}
if (time <=0) {
message T.T;
setlevel2 graallegacy_h04.nw,11,31;
scheduleevent(1,"Sailing","idle");
}
function onSailing() {
setlevel2 graallegacy_h04.nw,11,31;
}
i got the "scheduleevent(1,"Sailing","idle");" out of the "GBaddy" script (just to let you know...)
|
The schedule event in this situation seems very unneccessary, since you are warping at the end of sailing already..
You have a conditional outside of an event, which may be the reason its not triggering. if (time <= 0) is not an event, it is a conditional. nothing triggers that logic when it happens, so its a toss up to the engine if it gets called or not.
PHP Code:
//#CLIENTSIDE
if (created) { // This EVENT happens when the npc is created
time = 10;
}
if (playerenters) { // This EVENT happens when the player enters.
time = 10;
timeout = .1;
}
if (timeout) { // This EVENT happens when timeout reaches 0
time -= 1;
if (time <=0) { // This CONDITIONAL doesn't have anything trigger it
// so you have to test it inside an event, for example, timeout
message T.T;
setlevel2 graallegacy_h04.nw,11,31;
}
timeout = 2;
}