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

I need help Aol/Bless

Kociii

FTW = Fuck The What
Joined
Dec 24, 2009
Messages
543
Reaction score
1
Location
Sweden
I need help i help with Aol (Amulet of loss) and Bless!.

I can buy bless from the npc but i need a script so i only can say .!bless in the game chat and i will buy all bless for 5cc..

And aol, i doesen't even work when i use it, but bless work. But with aol i need help with
- Fix aol so you don't loose anything
- .!aol (the command)

If someone can help me please, i relly need fast! Thanks for respond
 
Add this to talkactions.xml

<talkaction words="!buybless;/buybless;!bless;/bless" script="bless.lua" />

Make a script called bless.lua

-- [( Script edited by: XouruS )] --
function onSay(cid, words, param)
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, 50000) == TRUE then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendMagicEffect(getPlayerPosition(cid), 28)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'You have been blessed by the gods!')
else
doPlayerSendCancel(cid, "You need 50.000 gold coins to get blessed!")
end
end
return TRUE
end


Change the price here
if doPlayerRemoveMoney(cid, 50000) == TRUE then
&
doPlayerSendCancel(cid, "You need 50.000 gold coins to get blessed!")
 
Code:
<talkaction words="!buybless;/buybless;!bless;/bless" script="bless.lua" />
Use this, instead of the one above, better coded.
bless.lua
Lua:
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_HOLYDAMAGE)
                end
            else
                doPlayerSendCancel(cid, "You do not have enough money to buy all the blessings!")
                break
            end
        end
    end
    if fail == 5 then
        doPlayerSendCancel(cid, "You already have all the blessings!")
    end
return TRUE
end

Code:
<talkaction words="!buyaol" event="script" value="buyaol.lua"/>
buyaol.lua
Lua:
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid,50000) then
    doPlayerAddItem(cid,2173,1)
    doSendMagicEffect(getPlayerPosition(cid),12)
    doPlayerSendTextMessage(cid,22,"You\'ve bought an Aol!")
else
    doPlayerSendCancel(cid,"You don\'t have enough money.")
    doSendMagicEffect(getPlayerPosition(cid),2)
end
return TRUE
end
 
Code:
<talkaction words="!buybless;/buybless;!bless;/bless" script="bless.lua" />
Use this, instead of the one above, better coded.
Lua:
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_HOLYDAMAGE)
                end
            else
                doPlayerSendCancel(cid, "You do not have enough money to buy all the blessings!")
                break
            end
        end
    end
    if fail == 5 then
        doPlayerSendCancel(cid, "You already have all the blessings!")
    end
return TRUE
end

Both work fine :D
 
http://otland.net/f81/buy-all-blessings-11174/#post116439

Lua:
function onSay(cid, words, param)
    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, 50000) == 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
    end    
    return 1
end
 
Code:
<talkaction words="!buybless;/buybless;!bless;/bless" script="bless.lua" />
Use this, instead of the one above, better coded.
bless.lua
Lua:
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_HOLYDAMAGE)
                end
            else
                doPlayerSendCancel(cid, "You do not have enough money to buy all the blessings!")
                break
            end
        end
    end
    if fail == 5 then
        doPlayerSendCancel(cid, "You already have all the blessings!")
    end
return TRUE
end

Code:
<talkaction words="!buyaol" event="script" value="buyaol.lua"/>
buyaol.lua
Lua:
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid,50000) then
    doPlayerAddItem(cid,2173,1)
    doSendMagicEffect(getPlayerPosition(cid),12)
    doPlayerSendTextMessage(cid,22,"You\'ve bought an Aol!")
else
    doPlayerSendCancel(cid,"You don\'t have enough money.")
    doSendMagicEffect(getPlayerPosition(cid),2)
end
return TRUE
end


Does this work the aol.. i mean .. Our aol doesen't work when people die they don't loose items.. So does this script work if u got aol u don't loose items?
 
I get this all the time ..
[26/09/2010 00:36:23] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/bless.lua)
[26/09/2010 00:36:23] cannot open data/talkactions/scripts/bless.lua: No such file or directory
Why?!!
 
Thats because either the name of the LUA file at talkactions is wrong, or you put the bless.lua at another folder or you didnt even add it, or it has different name.
 
Back
Top