Completely Puzzled By Func

09/05/2024 05:29 ForgottenRelic#1
I need a little bit of help with this confusing error im getting.

Im using this function :

Func _MoveToItem($agent) ; Carries on staying alive while collecting item
Local $lMe
If GetIsDead(-2) Then Return
$x = DllStructGetData($agent, "x")
$y = DllStructGetData($agent, "y")
MoveTo($x, $y) ; Change this to MoveToAggro/MoveTo/Move - Whatever your using as an advanced movement function
EndFunc

I have been using it on other scripts and works perfectly fine, however on a new one i am writting. I am getting a error that the $x is not being declared. I have looked at both scripts and im seeing nothing different between the two.

I do believe its something simple that i am just overlooking.

Thank you.
03/04/2025 21:41 Ac900#2
Func _MoveToItem($agent) ; Carries on staying alive while collecting item
Local $lMe, $x, $y
If GetIsDead(-2) Then Return
$x = DllStructGetData($agent, "x")
$y = DllStructGetData($agent, "y")
MoveTo($x, $y) ; Change this to MoveToAggro/MoveTo/Move - Whatever your using as an advanced movement function
EndFunc