Hello.
Please, use English on Forums.
I didn't tested this code, but i think this will work.
Notice that you MUST change the "SETTINGS.KNIFE_ID" to the obsidian knife id and SETTINGS.BODIES with the id of each body that you wanna use obsidian knife on.
The easiest way to find out bodies ids is by killing monster and using HUD->Show cursor info. Once you enable this option, you just need to move your mouse over the body and a simple hud will be displayed telling the item id, which will be the body id.
local SETTINGS = {
KNIFE_ID = 1234, -- Obsidian knife id
MAX_RANGE = 5, -- Max range/distance away to skin bodies
BODIES = { 1234, 4321, 5432 } -- Bodies IDs that you wanna skin.
}
if maround() == 0 and islooting() == false and lootbodies() == 0 then
local tiles = gettiles()
local player_x, player_y, player_z = posx(), posy(), posz()
for _, tile in ipairs(tiles) do
if tile.posz == player_z and math.abs(player_x - tile.posx) <= SETTINGS.MAX_RANGE and math.abs(player_y - tile.posy) <= SETTINGS.MAX_RANGE and tile.itemcount > 1 and table.find(SETTINGS.BODIES, tile.topitem.id) ~= nil then
pausewalking(10000)
stopattack()
if reachlocation(tile.posx, tile.posy, tile.posz, false) then
wait(500, 1000)
useitemon(SETTINGS.KNIFE_ID, tile.posx, tile.posy, tile.posz)
wait(500, 1000)
end
end
end
end