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
Obsidian Knife actions tool.lua
<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