Quote:
Originally posted by SkooL
NPC Code:
if (strequals(#m(sleep)&&||playersprite=38) {
showimg sleeping,emoticon_Zzz_stay.mng,playerx,playery-2;
}
if (!strequals(#m(sleep)&&||playersprite=38) {
hideimg sleeping;
}
Why do I get the error 'Error: Expected format: if (flag) command;'? It looks like the right format...=\
|
The second ( in your strequals check should be a , plus &&|| = &&0|| which means the script can never do anything.
Like this:
NPC Code:
if (playerenters||timeout) {
if (strequals(#m,sleep)||playersprite=38) showimg sleeping,emoticon_Zzz_stay.mng,playerx,player-2;
else hideimg sleeping;
timeout=0.05;
}
Although this would be the same as giving it an index of 0; since sleeping is a variable without a defined value it will default to 0.