• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Item give spell

70011983

Ners
Joined
Nov 21, 2011
Messages
354
Solutions
1
Reaction score
56
Location
Croatia
After using the item,why it doesn't dissapear? The problem is,you get the item,click on it,YOU RECEIVE THE SPELL,but the book is not gone,after you click again on it it says "You already know this spell" and then it's gone,but I want so it dissapears at the first use,not second...

Code:
local spell = "Super Exori"
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)
	else
		doCreatureSay(cid, "You already know this spell!", TALKTYPE_ORANGE_1, nil, cid, getThingPos(cid))
doPlayerRemoveItem(cid, 1985, 1) 
	end
	return true
end

Code:
    <action itemid="1985" event="script" value="ek1.lua"/>
 
Last edited:
Lua:
local spell = "Super Exori"
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, 1985, 1) 
	else
		doCreatureSay(cid, "You already know this spell!", TALKTYPE_ORANGE_1, nil, cid, getThingPos(cid))
	end
	return true
end
 
Back
Top