• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua script help

jackl90

Member
Joined
Jul 25, 2017
Messages
249
Reaction score
12
shovel script
LUA:
function onUse(player, item, fromPosition, target, toPosition)
    local tile = Tile(toPosition)
    if not tile then
        return false
    end

    if not target:isItem() then
        return false
    end
        
    if target:getId() == 231 then
        target:getPosition():sendMagicEffect(3)
        return true
    elseif target:getId() == 593 then
        target:transform(594, 1)
        target:decay()
        doRelocate(target:getPosition(), target:getPosition():moveRel(0,0,1))
        return true
        else
        return false
    end

    return true
end

my problem is if have some splash on target id, my shovel no work. how can i fix this?
 
not sure if your distro has but there should be a function called getTileItemById then search by toPosition and your item id.

not sure if easier way to do this in newer distros but it should work for ya :)
 
Back
Top