You have:
my $x;
my $y;
my $z;
my $h;
at the top of the script and then you have
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
inside the loop, where it stops working. I'm not a perl expert, but that may be the problem. I would remove the ones at the top.
|