
Originally Posted by
Raphael
You don't get the fucking id using isTarget(). That only proves they're different things.
You can't lie to the code, an this proves is the same thing...
Code:
function Creature:isTarget()
return self._id == getSelfTargetID()
end

Originally Posted by
Raphael
What I meant is, find the name of your target WITHOUT directly using getTargetId().
getTargetId() Doesn't exist, Probably you meant to say getSelfTargetID()
As I say before "getById(isTarget())" would be the way to get the name of your current target.
getById() is used to get their name by their id, so writing an id inside the "()" will tell you the name.
isTarget() will return the id of your current target.
This can also be written like the following codes.
Code:
GetByID(getSelfTargetID())
--or
getCreatureNameById(getSelfTargetID())
--or
GetByID(isTarget())
--or
getCreatureNameById(isTarget())
an example implemented on a script would be.
(examples taken from @sirmate all credits for him)
Code:
local target = Creature.GetByID(getSelfTargetID())
--or just the one I made
local targetname = Creature.GetByID(isTarget())