good morning to all! I need help with a script !! it is called captured fishing monster the script that I will show you was for tfs 0.3.2 and now I am already using tfs 0.3.6 and it does not work for me who can help me please?
function onUse(cid, item, frompos, item2, topos)
local r = {
[28] = 210,
[29] = 180,
[30] = 45}
local s = math.random(28,30)
if item.itemid == 5928 then
if getTilePzInfo(getThingPos(cid)) == FALSE then
if isMonster(item2.uid) == TRUE then
setItemArticle(item.uid, getCreatureName(item2.uid))
doRemoveCreature(item2.uid)
doSendMagicEffect(topos, s)
doSendAnimatedText(topos, 'Captured!', r)
doTransformItem(item.uid, 5929)
return TRUE
else
doSendMagicEffect(frompos, 2)
doPlayerSendCancel(cid, 'You cannot catch it.')
return TRUE
end
return TRUE
else
doPlayerSendCancel(cid, 'You cannot use in protection zone.')
doSendMagicEffect(frompos, 2)
return TRUE
end
elseif item.itemid == 5929 then
if getTilePzInfo(getThingPos(cid)) == FALSE then
doCreateMonster(getItemDescriptions(item.uid).article, getThingPos(cid))
return doRemoveItem(item.uid, 1)
else
return doPlayerSendCancel(cid, 'You cannot use in protection zone.')
end
end
return TRUE
end
function onUse(cid, item, frompos, item2, topos)
local r = {
[28] = 210,
[29] = 180,
[30] = 45}
local s = math.random(28,30)
if item.itemid == 5928 then
if getTilePzInfo(getThingPos(cid)) == FALSE then
if isMonster(item2.uid) == TRUE then
setItemArticle(item.uid, getCreatureName(item2.uid))
doRemoveCreature(item2.uid)
doSendMagicEffect(topos, s)
doSendAnimatedText(topos, 'Captured!', r
doTransformItem(item.uid, 5929)
return TRUE
else
doSendMagicEffect(frompos, 2)
doPlayerSendCancel(cid, 'You cannot catch it.')
return TRUE
end
return TRUE
else
doPlayerSendCancel(cid, 'You cannot use in protection zone.')
doSendMagicEffect(frompos, 2)
return TRUE
end
elseif item.itemid == 5929 then
if getTilePzInfo(getThingPos(cid)) == FALSE then
doCreateMonster(getItemDescriptions(item.uid).article, getThingPos(cid))
return doRemoveItem(item.uid, 1)
else
return doPlayerSendCancel(cid, 'You cannot use in protection zone.')
end
end
return TRUE
end