• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua OnUse - distance to target item

Lupek

New Member
Joined
Mar 30, 2020
Messages
26
Reaction score
1
Hello, i made very easy script for practice.
Lua:
function onUseRope2(player, item, target)
    if target:hasAttribute(ITEM_ATTRIBUTE_UNIQUEID) and target.uid == pickaxeUid then
        if player:getStorageValue(pickaxeUid) ~= 10000 then
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Oh i got pick")
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Oh i got pick")
            player:setStorageValue(pickaxeUid, 10000)
            player:addItem(2553)
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "I already got this pick")
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "I already got this pick")
        end
    end
end

Is that possible to change distance between character and target item?
i'm trying to make script with 2 squares target.

I want to use item on target in this distance. Example on photo below.

Something like this:
1586819565360.png
 
You can add this to your XML line, If I understood correctly.
XML:
allowfaruse="1"
 
Solution
Back
Top