• 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" Command does not work.

Rogge95

Rogge95
Joined
Sep 28, 2009
Messages
20
Reaction score
0
Hello everyone, I kind of need help with this problem because i get lots of complains that it doesnt work to do "!Bless" which pisses me off.

Here is how my talkactions.xml looks
Code:
<?xml version="1.0" encoding="UTF-8"?>
<talkactions>
	<!-- player talkactions -->
	<talkaction words="!buypremium" script="buyprem.lua"/>
	<talkaction words="!leavehouse" script="leavehouse.lua"/>
	<talkaction words="!save" script="save.lua"/>
	<talkaction words="!changesex" script="changesex.lua"/>
	<talkaction words="!uptime" script="uptime.lua"/>
	<talkaction words="!deathlist" script="deathlist.lua"/>
      <talkaction words="!shop" script="znoteshop.lua"/>
      <talkaction words="!buybless;/buybless;!bless;/bless" script="bless.lua" />


	<!-- test talkactions -->
	<talkaction words="!z" script="magiceffect.lua"/>
	<talkaction words="!x" script="animationeffect.lua"/>
</talkactions>

And this is the bless.lua file.
Code:
-- [( Made by LucasOlzon from otland.net )] --
function onSay(cid, words, param)
local fail = 0
 
	if getPlayerLevel(cid) < 31 then
		cost = 2000
	else
		cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
	end
 
	if cost > 20000 then
		cost = 20000
	end
 
	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			fail = fail + 1
		else
			if doPlayerRemoveMoney(cid, cost) == TRUE then
				doPlayerAddBlessing(cid, i)
				if i == 5 and not(fail == 5) then
					doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
				end
			else
doCreatureSay(cid, "You do not have enough money to buy all the blessings or cap/slot to get the rest of money!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
				break
			end
		end
	end
	if fail == 5 then
		doPlayerSendCancel(cid, "You already have all the blessings!")
	end
return TRUE
end

Is there ANYONE that could help me, and tell me why this doesn't work?

Im using this server: http://otland.net/f18/9-60-9-61-forgotten-server-v0-2-14-mystic-spirit-166619/
 
This is what i use: Try it.

Put under section "Players" at the talkaction.xml
Lua:
<talkaction words="!buybless;/buybless;!bless;/bless" script="bless.lua"/>

Put this in > Talkaction > Scripts > bless.lua
Lua:
-- [( Made by LucasOlzon from otland.net )] --
function onSay(cid, words, param)
local fail = 0
 
	if getPlayerLevel(cid) < 31 then
		cost = 2000
	else
		cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
	end
 
	if cost > 20000 then
		cost = 20000
	end
 
	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			fail = fail + 1
		else
			if doPlayerRemoveMoney(cid, cost) == TRUE then
				doPlayerAddBlessing(cid, i)
				if i == 5 and not(fail == 5) then
					doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
				end
			else
doCreatureSay(cid, "You do not have enough money to buy all the blessings or cap/slot to get the rest of money!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
				break
			end
		end
	end
	if fail == 5 then
		doPlayerSendCancel(cid, "You already have all the blessings!")
	end
return TRUE
end
 
This is what i use: Try it.

Put under section "Players" at the talkaction.xml
Lua:
<talkaction words="!buybless;/buybless;!bless;/bless" script="bless.lua"/>

Put this in > Talkaction > Scripts > bless.lua
Lua:
-- [( Made by LucasOlzon from otland.net )] --
function onSay(cid, words, param)
local fail = 0
 
	if getPlayerLevel(cid) < 31 then
		cost = 2000
	else
		cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
	end
 
	if cost > 20000 then
		cost = 20000
	end
 
	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			fail = fail + 1
		else
			if doPlayerRemoveMoney(cid, cost) == TRUE then
				doPlayerAddBlessing(cid, i)
				if i == 5 and not(fail == 5) then
					doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
				end
			else
doCreatureSay(cid, "You do not have enough money to buy all the blessings or cap/slot to get the rest of money!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
				break
			end
		end
	end
	if fail == 5 then
		doPlayerSendCancel(cid, "You already have all the blessings!")
	end
return TRUE
end

I use the same, if u check the codes i wrote at the top of this page..
 
@up
Is why have 9.60-9.61 have other functions


I edit script here you go
Lua:
-- [( Made by LucasOlzon from otland.net )] --
local fail = 0
local cost = 20000

function onSay(cid, words, param)
local new_cost = (lvl * cost) / 500
local target = getPlayerGUID(cid)

              for i = 1, 5 do
                if getPlayerBlessing(cid, i) then
                        doPlayerSendCancel(cid, "You already have all the blessings!.")
                        return TRUE
                end
        end
                if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
                        for i = 1, 5 do
                        doPlayerAddBlessing(cid, i)
                        doPlayerSendTextMessage(cid,22,"You have been successfully blessed.!")
                        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
                end
                else
                doCreatureSay(cid, "You do not have enough money to buy all the blessings or cap/slot to get the rest of money!", TALKTYPE_ORANGE_1)
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
                end
        return FALSE
end
 
@up
Is why have 9.60-9.61 have other functions


I edit script here you go
Lua:
-- [( Made by LucasOlzon from otland.net )] --
local fail = 0
local cost = 20000

function onSay(cid, words, param)
local new_cost = (lvl * cost) / 500
local target = getPlayerGUID(cid)

              for i = 1, 5 do
                if getPlayerBlessing(cid, i) then
                        doPlayerSendCancel(cid, "You already have all the blessings!.")
                        return TRUE
                end
        end
                if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
                        for i = 1, 5 do
                        doPlayerAddBlessing(cid, i)
                        doPlayerSendTextMessage(cid,22,"You have been successfully blessed.!")
                        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
                end
                else
                doCreatureSay(cid, "You do not have enough money to buy all the blessings or cap/slot to get the rest of money!", TALKTYPE_ORANGE_1)
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
                end
        return FALSE
end

:S It doesn't work with ur script either, i put your script instead of the old one, and "reloaded" talkactions in console, but still doesnt work.. :(
 
Try:
(Add them both, aol + bless or script might don't fully work. Just backup ur aol somewhere else.

Hello,

I got bored so i going to release a script which i made 5-8min ago, i didnt test it but i hope it works.

Talkactions.xml
Code:
<talkaction words="!aol" case-sensitive="no" event="script" value="ab.lua"/>
<talkaction words="!bless" case-sensitive="no" event="script" value="ab.lua"/>

Then make a lua file in talkactions/scripts and name it "ab"
Lua:
local aol_otswe = {
cost = 10000,
buy_text = "You have bought amulet of loss! if you wear it, you will not lose any kind of items expect if you are red skull.",
cancel_text = "Sorry but you dont have afford to buy amulet of loss!",
effect = 49
}

local bless_otswe = {
cost = 50000,
cancel_text = "Sorry, but you are already blessed by the gods!",
buy_text = "You have been blessed by the gods!",
effect = CONST_ME_HOLYDAMAGE,
cancel_text_onbuy = "Sorry, but you dont have afford to buy bless!"
}

function onSay(cid, words, param)
if words == "!aol" then
   if doPlayerRemoveMoney(cid, aol_otswe.cost) == TRUE then 
   doPlayerAddItem(cid,2173,1)
   doSendMagicEffect(getPlayerPosition(cid), aol_otswe.effect)
   doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, aol_otswe.buy_text)
    else 
   doPlayerSendCancel(cid, aol_otswe.cancel_text) 
   end
   return true
  end 
end

if words == "!bless" then
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
   doPlayerSendCancel(cid,bless_otswe.cancel_text)
    else
        if doPlayerRemoveMoney(cid, bless_otswe.cost) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
	    doSendMagicEffect(getPlayerPosition(cid), bless_otswe.effect)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,bless_otswe.buy_text)
        else
            doPlayerSendCancel(cid, "bless_otswe.cancel_text_onbuy")
        end
    end 
  return true
end

Enjoy!
 
fail in end
try this
Lua:
-- [( Made by LucasOlzon from otland.net )] --
local bless = {1, 2, 3, 4, 5}
local cost = 50000
local maxlevel = 50000

function onSay(cid, words, param)
local lvl = getPlayerLevel(cid)
local new_cost = (lvl * cost) / 500
local target = getPlayerGUID(cid)


        for i = 1, table.maxn(bless) do
                if(getPlayerBlessing(cid, bless[i])) then
                        doPlayerSendCancel(cid, "You have already have been blessed.")
                        return TRUE
                end
        end
        
        if (getPlayerLevel(cid) >= maxlevel)  then
                if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
                        for i = 1, table.maxn(bless) do
                        doPlayerAddBlessing(cid, bless[i])
                        doPlayerSendTextMessage(cid,22,"You have been successfully blessed.!")
                end
                else
                doPlayerPopupFYI(cid, "You need "..new_cost.." to buy blessings.")
                end
        
        elseif(getPlayerLevel(cid) < maxlevel) then
                if(doPlayerRemoveMoney(cid, cost) == TRUE) then
                        for i = 1, table.maxn(bless) do
                        doPlayerAddBlessing(cid, bless[i])
                        end
                        doPlayerPopupFYI(cid, "You have successfully been blessed.")
                else
                        doPlayerPopupFYI(cid, "You need to have "..cost.."gp to buy blessings.")
                end
        end
        return FALSE
end
 
Try:
(Add them both, aol + bless or script might don't fully work. Just backup ur aol somewhere else.

Daamn, doesn't work either, getting mad at this...

- - - Updated - - -

fail in end
try this
Lua:
-- [( Made by LucasOlzon from otland.net )] --
local bless = {1, 2, 3, 4, 5}
local cost = 50000
local maxlevel = 50000

function onSay(cid, words, param)
local lvl = getPlayerLevel(cid)
local new_cost = (lvl * cost) / 500
local target = getPlayerGUID(cid)


        for i = 1, table.maxn(bless) do
                if(getPlayerBlessing(cid, bless[i])) then
                        doPlayerSendCancel(cid, "You have already have been blessed.")
                        return TRUE
                end
        end
        
        if (getPlayerLevel(cid) >= maxlevel)  then
                if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
                        for i = 1, table.maxn(bless) do
                        doPlayerAddBlessing(cid, bless[i])
                        doPlayerSendTextMessage(cid,22,"You have been successfully blessed.!")
                end
                else
                doPlayerPopupFYI(cid, "You need "..new_cost.." to buy blessings.")
                end
        
        elseif(getPlayerLevel(cid) < maxlevel) then
                if(doPlayerRemoveMoney(cid, cost) == TRUE) then
                        for i = 1, table.maxn(bless) do
                        doPlayerAddBlessing(cid, bless[i])
                        end
                        doPlayerPopupFYI(cid, "You have successfully been blessed.")
                else
                        doPlayerPopupFYI(cid, "You need to have "..cost.."gp to buy blessings.")
                end
        end
        return FALSE
end

Doesn't work!! I do something wrong, because this does not make any sence at all why it shouldn't work, the script looks fine to me..
 
Not works? i tested in 9.60 - 9.61 - 9.63
and works fine

Well, doesn't work for me -. - i made a new lua file called "bless" in script folder, and then i made a XML called "bless" and put what u wrote in my script folder, but then idk whats the problem..
 
Is it possible there's too many variations of the command to buy bless? I don't know if it would work but take out the !buybless and /buybless and see if !bless /bless works. Worth a shot.
 
Is it possible there's too many variations of the command to buy bless? I don't know if it would work but take out the !buybless and /buybless and see if !bless /bless works. Worth a shot.

Used another command before, but didnt work either, can try another again though :)

- - - Updated - - -

Is it possible there's too many variations of the command to buy bless? I don't know if it would work but take out the !buybless and /buybless and see if !bless /bless works. Worth a shot.

Didn't work.. Seriously, im doing something wrong, but just don't know what :S I even made a command for my website shop "!Shop" and it works fine.. Just not the bless command.
 
Back
Top