• 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 Spell item

70011983

Ners
Joined
Nov 21, 2011
Messages
354
Solutions
1
Reaction score
56
Location
Croatia
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.

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:
Lua:
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)
                doRemoveItem(item.uid, 1) 
	else
		doCreatureSay(cid, "You already know this spell!", TALKTYPE_ORANGE_1, nil, cid, getThingPos(cid))
	end
	return true
end
 

Similar threads

Back
Top