Page 1 of 1

refering to an object

Posted: 2005-07-14 20:12:02
by verY
sup mates
im having just a quick question about objects
lets have a look at the following script (its dumb but it shows my problem):

sub test()
if uo.gethealth(lastattack) > 0 then
uo.print ("target alive")
endif
end sub

when i wanna exec it, it says: "variable undefined - lastattack"

but why? lastattack is meant to a pointer to the object(player) i attacked last..
and when i do something like

uo.cast ("'Flame' lastattack") it works..

so where is the misstake in the 1st script?

kthx for answers

Posted: 2005-07-14 20:15:29
by flake
You don't have a uo.gethealth(onject) finction, so use UO.GetHP(object).
Other stuff is correct.

omfg thx

Posted: 2005-07-14 20:25:26
by verY
the misstake was actually that it has to be...

if uo.getHP("lastattack") > 0 then

... as it seems

kthx for quick reply