So, I got a script that when you use an item, it gives you the spell, already asked for it here and some nice guys fixed it for me
But, now I found out something, if you put it on the ground and use it, it wont dissapear as it should.
Could anyone fix that? So it gets used, no matter if its in your BP or on the ground.
But, now I found out something, if you put it on the ground and use it, it wont dissapear as it should.
Could anyone fix that? So it gets used, no matter if its in your BP or on the ground.
Code:
local spell = "Mega Don Spell"
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not getPlayerLearnedInstantSpell(cid, spell) then
doPlayerLearnInstantSpell(cid, spell)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have learned spell " .. spell .. "!")
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doPlayerRemoveItem(cid, 9004, 1)
else
doCreatureSay(cid, "You already know this spell!", TALKTYPE_ORANGE_1, nil, cid, getThingPos(cid))
end
return true
end
Last edited: