• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

blessing book

Maxypad

New Member
Joined
Mar 13, 2012
Messages
35
Reaction score
0
im sure this script has been post fews time but it seem i cant find it..and ofc i have search in the search option.. so here is what i need

that when you use a blessing book,it give u the 5 blessing and i dont want it to dispear after use so basiccly i want it to be infinite


the item is : 02:40 You see a heavily bound book.
ItemID: [8983].


thank :)
 
LUA:
 local b = 1,5

function onUse(cid, item, frompos, item2, topos) 
	if getPlayerBlessing(cid, b) then
		doPlayerSendCancel(cid, "You have already recieved Blessings!")
	else
			doPlayerAddBlessing(cid, b)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have recieved Blessings!")
	end
return true
end

should work let me know if theres issues.
 
local cfg = {
bless = { 1, 2, 3, 4, 5 },
level = 8
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
for i = 1, table.maxn(cfg.bless) do
if(getPlayerBlessing(cid, cfg.bless)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doCreatureSay(cid, "You have already been blessed.", TALKTYPE_ORANGE_1)
return true
end
end
if getPlayerLevel(cid) >= cfg.level then
for i = 1, table.maxn(cfg.bless) do
doPlayerAddBlessing(cid, cfg.bless)
end
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
doSendAnimatedText(getCreaturePosition(cid), "BLESSED!", TEXTCOLOR_RED)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been blessed by the gods.")
end
return true
end


Dont forget to name it blessbookuse.lua And then put this in your Actions, <action itemid="8983" event="script" value="blessbookuse.lua"/>

Rep if works :)
 
test this


function onUse(cid, item, frompos, item2, topos)

if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
doPlayerSendCancel(cid,'You have already got one or more blessings!')
else
if doPlayerRemoveMoney(cid, 0) == TRUE then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
else
doPlayerSendCancel(cid, "You need 5 crystal coin to get blessed!")
end
return 1
end
end
 
LUA:
function onUse(cid, item, frompos, item2, topos)
local bless = 1, 5
	
	if(getPlayerBlessing(cid, bless)) then
		doPlayerSendCancel(cid, "You have already recieved Blessings!")
	else
		doCreatureSetDropLoot(cid, false)
		doPlayerAddBlessing(cid, bless)	
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have recieved Blessings!")
		return true
	end
	return true
end

#Edit
Better? But now my version is similar like your Owned, so we can said that my post is a spam...
 
Last edited:
rep both of you :) but owned did a new script and this 1 work perfectly so credit to him for this code :)

Code:
 local b = 1,5
 
function onUse(cid, item, frompos, item2, topos) 
	if getPlayerBlessing(cid, b) then
		doPlayerSendCancel(cid, "You have already recieved Blessings!")
	else
			doCreatureSetDropLoot(cid, false)
			doPlayerAddBlessing(cid, b)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have recieved Blessings!")
	end
return true
end
 
Even though i already pm'd the script, id just like to say... Garqet, i dont understand why you throw unneccessary things in your script lol.
 
Back
Top