• 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!

Blessing Item REP+

Alls

New Member
Joined
Jan 17, 2008
Messages
26
Reaction score
1
I'm looking for a script when you click an item it's give all the blessings and then disappears.
Thanks.

Ps : 0.3.5
 
I'm looking for a script when you click an item it's give all the blessings and then disappears.
Thanks.

Ps : 0.3.5

make in ...data/actions/scripts/
item-bless.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        doCreatureSay(cid, "You are blessed now !", TALKTYPE_ORANGE_1)
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
	 doRemoveItem(item.uid,[COLOR="Red"]ITEM-ID[/COLOR])
    end

Put your item ID here

and to actions.xml add
Code:
        <action itemid="[COLOR="Red"]ITEM-ID[/COLOR]" script="item-bless.lua"/>

:)
 
Try my, not tested ;)

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
	item = 6527,  -- Item ID --
	count = 1  -- Item Count --
}
for i = 1, 5 do
	if(getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5)) then
		doPlayerSendCancel(cid, "You are already blessed!")
		doSendMagicEffect(getPlayerPoition(cid), CONST_ME_POFF)
		return true
	end
	if(doPlayerRemoveItem(cid, config.item, config.count) == true and getPlayerBlessing(cid, 1)) then
		doCreatureSay(cid, "Blessed!", TALKTYPE_ORANGE_1)
		doSendAnimatedText(getPlayerPosition(cid), "Aaaaah!", math.random(1, 255))
		doSendMagicEffect(getPlayerPosition(cid), 37)
		doPlayerAddBlessing(cid, i)
		return true
	end
	if(doPlayerRemoveItem(cid, config.item, config.count) ~= true)
		doPlayerSendCancel(cid, "You dont have enought money.")
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
			end
		end		
	return true
end
 
Back
Top