johnsamir
Advanced OT User
Hello community
I'm trying to convert an script that was made for othire. Must add that im using tfs 1.3/1.4
The script work, the problem is that when i use potion on the ground it doesn't drop the splash, it simply heals the player as if the potion were used on the player when it was not.
this is the original script.
and this is was i got, 2025, 7 is the id of the splash, 5604 the empty vial
ideas of what could be wrong? have no error being displayd in console
I'm trying to convert an script that was made for othire. Must add that im using tfs 1.3/1.4
The script work, the problem is that when i use potion on the ground it doesn't drop the splash, it simply heals the player as if the potion were used on the player when it was not.
this is the original script.
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if toPosition.x == 65535 or toPosition.x == 0 then
return true
end
local used = function(splash)
doChangeTypeItem(item.uid, item.type - 1)
if splash then
doDecayItem(doCreateItem(2025, 7, toPosition))
end
return true, fromPosition.x == 65535 and doPlayerAddItem(cid, 6000, 1) or doCreateItem(6000, 1, fromPosition)
end
if getTopCreature(toPosition).uid ~= cid then
return used(true)
end
doPlayerAddMana(cid, 300)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
doPlayerSay(cid, "Aaaah...", TALKTYPE_SAY)
return used(false)
end
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if toPosition.x == 65535 or toPosition.x == 0 then
return true
end
local used = function(splash)
doChangeTypeItem(item.uid, item.type - 1)
if splash then
doDecayItem(doCreateItem(2025, 7, toPosition))
end
return true, fromPosition.x == 65535 and player:addItem(5604, 1) or doCreateItem(5604, 1, fromPosition)
end
--if getTopCreature(toPosition).uid ~= cid then
-- return used(true)
--end
-- doPlayerAddMana(cid, 300)
player:addMana(math.random(50, 100))
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
--doPlayerSay(cid, "Aaaah...", TALKTYPE_SAY)
player:say("Aaaah...", TALKTYPE_SAY) --TALKTYPE_MONSTER_SAY) agregado
return used(false)
end
Last edited: