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

!bless script request

shawntio

Member
Joined
Apr 14, 2008
Messages
737
Reaction score
5
Location
sweden
Hello, i need !bless script. Example: !bless you have been blessed, with the first blessing, spirutal solitude or what the name is" what i mean is, that nu need to say !bless 5 times, to get all the 5 blessings and i want the magic effect thing when your buying the blessings

Please reply Thanks!
 
ReP++
Lua:
local money = 1000 --How much money he needs to one blessing
function onSay(cid, words, param)
if getPlayerBlessing(cid, 0) then
  if doPlayerRemoveMoney(cid, money) == TRUE then
      doPlayerAddBlessing(cid, 1)
	  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_RED)
      doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have bought first blessing!')
	  else
	  doPlayerSendCancel(cid, "You need "..money.." coins to get blessed!")
     end
elseif getPlayerBlessing(cid, 1) then
if doPlayerRemoveMoney(cid, money) == TRUE then
      doPlayerAddBlessing(cid, 2)
	  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_YELLOW)
      doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have bought second blessing!')
	  else
	  doPlayerSendCancel(cid, "You need "..money.." coins to get blessed!")
     end
elseif getPlayerBlessing(cid, 2) then
if doPlayerRemoveMoney(cid, money) == TRUE then
      doPlayerAddBlessing(cid, 3)
	  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_YELLOW)
      doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have bought third blessing!')
	  else
	  doPlayerSendCancel(cid, "You need "..money.." coins to get blessed!")
     end
elseif getPlayerBlessing(cid, 3) then
if doPlayerRemoveMoney(cid, money) == TRUE then
      doPlayerAddBlessing(cid, 4)
	  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_BLUE)
      doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have bought fourth blessing!')
	  else
	  doPlayerSendCancel(cid, "You need "..money.." coins to get blessed!")
     end
elseif getPlayerBlessing(cid, 4) then
if doPlayerRemoveMoney(cid, money) == TRUE then
      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 "..money.." coins to get blessed!")
     end
end
return 1
end
 
Name that script above with name blessings.lua
and in talkactions.xml add
Code:
<talkaction words="!bless" event="script" value="blessings.lua" />
<talkaction words="!buybless" event="script" value="blessings.lua" />
 
Name that script above with name blessings.lua
and in talkactions.xml add
Code:
<talkaction words="!bless" event="script" value="blessings.lua" />
<talkaction words="!buybless" event="script" value="blessings.lua" />

Code:
<talkaction words="!bless;!buybless" event="script" value="blessings.lua" />
 
Hello, i need !bless script. Example: !bless you have been blessed, with the first blessing, spirutal solitude or what the name is" what i mean is, that nu need to say !bless 5 times, to get all the 5 blessings and i want the magic effect thing when your buying the blessings

Please reply Thanks!

I waste a lot of time making the price line so i hope you use this and i hope this works :D(PD: I don't remember if blessing functions works in this way xP)
Lua:
local levelNeeded = 30
local basePrice = 2000
local blessLeveled = true
local bless = {}
local t = 0

function onSay(cid, words, param, channel)

	local level = getPlayerLevel(cid)
	local v = (blessLeveled and ((level > 30 and level < 120) and ((level - 30) * 200 + basePrice) or level > 120 and 20000 or level < 30 and basePrice) or 10000)
	for i = 1, 5 do
		if not getPlayerBlessing(cid, i) then
			table.insert(bless, i)
			t = t + 1
		end
	end
	
	if level >= levelNeeded then
		local price = v
		if doPlayerRemoveMoney(cid, price * t) then
			for i = 1, 5 do
				if not getPlayerBlessing(cid, i) then doPlayerAddBlessing(cid, i) end
			end
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, (price * t > 0 and "You bought " .. t .. " blessings for " .. price * t .. " gold coins." or "You already have all blessings."))
			doSendMagicEffect(getCreaturePosition(cid), (price * t > 0 and CONST_ME_MAGIC_RED or CONST_ME_POFF))
			price = 0
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have enough money.")
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need level " .. levelNeeded .. " or higher to buy blessings.")
		return true
	end
end
 
Last edited:
i tested both of yours scripts but when i buy a bless it says You bought 2 blessings for 32400 gold coins. and when i say !bless again You bought 2 blessings for 32400 gold coins.
 
i tested both of yours scripts but when i buy a bless it says You bought 2 blessings for 32400 gold coins. and when i say !bless again You bought 2 blessings for 32400 gold coins.

Code:
<talkaction words="!bless;!buybless"  event="script" value="blessings.lua" />

Perhaps it's running twice because it's referenced twice?
 
Back
Top Bottom