• 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!

TFS 1.X+ Obsidian Knife tfs 1.5

bpm91

Intermediate OT User
Joined
May 23, 2019
Messages
881
Solutions
7
Reaction score
122
Location
Brazil
YouTube
caruniawikibr
hello, I took this script and tried to use it in tfs 1.5 but it is giving this error, could anyone tell me how I can fix it so that it is not used in sumons for example?

<event type="kill" name="SummonKill" script="obsidianknife.lua"/>
<event type="login" name="obs_login" script="obsidianknife.lua"/>
<event type="death" name="ObMonsterCheck" script="obsidianknife.lua"/>

creature scripts
Lua:
function onLogin(cid)
registerCreatureEvent(cid, "SummonKill")
return true
end
function onKill(cid, target)
if isMonster(target) and isPlayer(getCreatureMaster(target)) then
registerCreatureEvent(target, "ObMonsterCheck")
end

return true
end
function onDeath(cid, corpse)
doItemSetAttribute(corpse.uid, "aid", 91347)
return true
end






Obsidian Knife actions tool.lua
Lua:
local MINOTAUR_LEATHER, LIZARD_LEATHER, GREEN_DRAGON_LEATHER, RED_DRAGON_LEATHER, HARDENED_BONE, BEHEMOTH_FANG = 5483, 5485, 5484, 5482, 5479, 5531

local config = {
[3090] = {25, MINOTAUR_LEATHER},
[2871] = {25, MINOTAUR_LEATHER},
[2866] = {25, MINOTAUR_LEATHER},
[2876] = {25, MINOTAUR_LEATHER},
[2844] = {25, GREEN_DRAGON_LEATHER},
[2881] = {25, RED_DRAGON_LEATHER},
[2931] = {25, BEHEMOTH_FANG},
[4256] = {25, LIZARD_LEATHER},
[4259] = {25, LIZARD_LEATHER},
[4262] = {25, LIZARD_LEATHER},
[5369] = {25, LIZARD_LEATHER},
[5357] = {25, LIZARD_LEATHER},
[5366] = {25, LIZARD_LEATHER},
[5363] = {25, LIZARD_LEATHER},
[5360] = {25, LIZARD_LEATHER},
[3031] = {25, HARDENED_BONE}
}




function onUse(cid, item, fromPosition, itemEx, toPosition)
-- summons
if itemEx.actionid == 91347 then
return doPlayerSendCancel(cid, "You cant skin a summon corpse.")
end

-- Skinning
v = config[itemEx.itemid]
if not v then
return false
elseif math.random(100) <= v[1] then
doPlayerAddItem(cid, v[2], 1)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)
else
doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
end
doTransformItem(itemEx.uid, itemEx.itemid + 1)
doDecayItem(itemEx.uid)
return true
end



1655767924847.png
 
check in luascript.lua for doItemSetAttribute, maybe its lttle different named or your source missing the func "doItemSetAttribute"
 
why not use the script that already comes with tfs and just remove the ids of monsters that you don't have?

I was looking for this but couldn't find it :/

i use a simpler one


Lua:
local SKINS = {
    
[5521] = {

[2830] = {20000, 5483}, --MINOTAURS
[2871] = {20000, 5483},
[2866] = {20000, 5483},
[2876] = {20000, 5483},
[3090] = {20000, 5483},

        
[4259] = {20000, 5485}, --LIZARDS
[4262] = {20000, 5485},
[4256] = {20000, 5485},

        
[3104] = {20000, 5484},
[2844] = {20000, 5484}, -- DRAGON

        
[2881] = {15000, 5482}, --DL

        
[2931] = {15000, 5531}, --BEHE

        
[3031] = {15000, 5479} --BONEBEAST
    },
    
[5522] = {
        
[2956] = {15000, 5491}, --vamp


[2916] = {10000, 5492} --demon
    }
}



function onUse(cid, item, fromPosition, itemEx, toPosition)
    
local skin = SKINS[item.itemid][itemEx.itemid]
    
if(skin == nil) then
        
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
        
return true
    
end

    
local random, effect = math.random(1, 100000), CONST_ME_MAGIC_GREEN
    if(random <= skin[1]) then

doPlayerAddItem(cid, skin[2], 1)
    
elseif(skin[3] and random >= skin[3]) then
        
doPlayerAddItem(cid, skin[4], 1)
    
else
        
effect = CONST_ME_BLOCKHIT
    
end

    
doSendMagicEffect(toPosition, effect)
    
doTransformItem(itemEx.uid, itemEx.itemid + 1)
    
return true

end
 
Last edited:
Back
Top