Lineage 2 Tower Forum

Full Version: A litte help with script Protect Support
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys, I'm trying to use this script, but when I start that, the following error appears : Attempt to index a number value. Anyone knows who I concert this error ? ( Sorry for my bad english)



Code:
CoverTarget = "Xyz"

repeat
    tar = GetUserByName(CoverTarget)
    if tar ~= nil then
        cid = tar:GetId()
        monsters = GetMonsterList()
        for m in monsters.list do
            if m:GetTarget():GetId() == cid then
                Target(m)
                break
            end
        end
    end
until false;
Anyone ?
Quote:User::GetTarget(): int [Method]
Method returns user target id. You need to know that on some l2j server information about monster target is not send.

Quote:if m:GetTarget():GetId() == cid then
Thanks for the reply, but I do not understand what you said, it is possible to run this script in official server?
just change
Code:
if m:GetTarget():GetId() == cid then
to
Code:
if m:GetTarget() == cid then
worked, thank you reynart !
Reference URL's