![]() |
Arrays....
-=Josey=-
Ok, I know how to use arrays farely well, but, I've ran into a delima. NPC Code: This doesn't seem to work right for me. Maybe I'm doing it wrong or maybe I done it right in this thread. I'm at work and yet to test it. Thanks for any help. |
Dunno, I've never used arrays, but I've seen a script like this that worked:
[code] if (playerenters){ this.arrayX={x+1,x+2,x+3,x+4,x+5}; this.arrayY={y+1,y+2,y+3,y+4,y+5}; timeout=.05; } if (timeout){ if (playerx in |this.arrayX| && playery in |this.arrayY|){ message Testing...; } timeout=.05; } |
NPC Code: that should work, im new to the in thing to be honest |
if (playerx in |this.arrayX| && playery in |this.arrayY|) {
message Testing...; } Thats right. ;) Quote:
NPC Code: :p |
-=Josey=-
Thanks everyone. I was just confused using the "in" command. ;D |
I think all here were wrong :)
If you do playerx in this.arrayX then it checks if playerx is in the array (the exact value of playerx, so its only true if its equal to one of the 5 entries of the array). To check for a range do playerx in |x+1,x+5| |
Quote:
|
Quote:
Quote:
NPC Code: right? |
| All times are GMT +2. The time now is 01:03 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.