Greetings!
I haven't played Graal or coded for Graal in a long time now. However, I am getting back into it. Since this is my first post in a very long time I would like to state that I've became much more of an experienced Scripter after learning a lot of Java and learned how to write much better since I aged and got a better education. So please forgive me if in my past I ever sounded like I was immature, as I have changed now. Thank you.
Anyways, I have ran into an issue with some of my code that I'm working on. The code is posted below:
getPlayers function:
PHP Code:
function getPlayers() {
temp.array = {};
for (temp.i : players) {
if (temp.i.level.name == player.level.name) {
if (temp.i.x in |mousestart[0], mousestart[2]| && temp.i.y in |mousestart[1], mousestart[3]|) {
temp.array.add(findplayer(temp.i).account);
}
}
}
return temp.array;
}
Test function:
PHP Code:
function Test(playerss) {
for (temp.i : playerss) {
findplayer(temp.i).chat = "WOOT";
}
}
The issue is, is that whenever the first even fires, it doesn't seem to add anything to the array because when I try and do: "player.chat = temp.array" nothing happens. I'm sure that these events are being properly called through my script and this is the line that is combined these functions: "Test(getPlayers());". It appears the chat doesn't say 0 either as I think it would if I remember correctly if you use an empty array. Thank you and please help me!