• 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 Issue with AOL and Blessing Script

Do you get any errors in your console?

Just to clarify, on this part:
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

You did name it ab.lua right?
 
Be sure to chose a fitting title for your thread next time, describing what your problem is about.
I renamed it for you this time.
 
Try this for the AOL(save it as aol.lua) :
Lua:
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid, 10000) == TRUE then
doPlayerAddItem(cid, 2173, 1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_BATS)
else
doPlayerSendCancel(cid, 'no you have insufficient coins.')
end
return TRUE
end

And add this line into talkactions.xml:

Lua:
< talkaction words="!aol" script="aol.lua" />
 
Last edited by a moderator:
Sorry about the title.

- - - Updated - - -

Try this for the AOL(save it as aol.lua) :
Lua:
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid, 10000) == TRUE then
doPlayerAddItem(cid, 2173, 1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_BATS)
else
doPlayerSendCancel(cid, 'no you have insufficient coins.')
end
return TRUE
end

And add this line into talkactions.xml:

Lua:
< talkaction words="!aol" script="aol.lua" />



Thank you i will try it :)

Edit: it worked thanks
 
Last edited:
This is the final code if anyone is interested.
Thanks to everyone below who helped me.

Code:
function onSay(cid, words, param)
    for i = 1,5 do
		if(getPlayerBlessing(cid, i)) then
			doPlayerSendCancel(cid, "You already have all of the blessings.")
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
			return true
		end
	end

    if doPlayerRemoveMoney(cid, 50000) == TRUE then
        for i = 1,5 do
            doPlayerAddBlessing(cid, i)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have pruchased all the blessings!")
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need 50,000 gp in backpack for blessings.")
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    end
    return TRUE
end

Worked 4 me.
 
- - - Updated - - -



i do yes :)

1) http://otland.net/f81/bless-script-41094/

OR:

Lua:
-- !blessing
local cost = 50000 -- Cost in gp.

function onSay(cid, words, param)




if getPlayerBlessing(cid, 5) == TRUE then
doPlayerSendCancel(cid, "You have already have been blessed.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end

if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendAnimatedText(getCreaturePosition(cid), 'Blessed!!!', TEXTCOLOR_DARKORANGE)
return TRUE
else
doPlayerPopupFYI(cid, "You need to have "..cost.."gp to buy blessings.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end



end

Add this into talkactions.xml:
Code:
<talkaction words="!bless" script="blessing.lua"/>

To change the price of the bless change the value in the first row in the script.
 
Back
Top