Hynora
New Member
- Joined
- Feb 13, 2016
- Messages
- 6
- Reaction score
- 0
I'm trying to do spell onuse depends on rebirth of character so if someone got rebirth 5 he can get the spell.
i hope you understand me TFS 3884 (0.4)local spells = {
[xxxx] = "REBIRTH 1",
[xxxx] = "REBIRTH 5",
[xxxx] = "REBIRTH 10",
[xxxx] = "Spell-words",
}
function onUse(cid, item, frompos, itemEx, topos)
if(spells[item.itemid]) then
if(not(getPlayerLearnedInstantSpell(cid, spells[item.itemid]))) then
doPlayerLearnInstantSpell(cid, spells[item.itemid])
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
doPlayerSendTextMessage(cid, 20, "Congratulations! You have successfully learnes " .. spells[item.itemid])
doRemoveItem(cid, item.uid, 1)
else
doPlayerSendCancel(cid, "You already know this spell.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
return true
end