I need help Aol/Bless

Kociii

FTW = Fuck The What
Joined
Dec 24, 2009
Messages
543
Best answers
0
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
 

XouruS

Active Member
Joined
Dec 29, 2009
Messages
941
Best answers
0
Reaction score
36
Location
Canada
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!")
 

Sublime

11.12.11
Joined
Mar 18, 2010
Messages
1,427
Best answers
0
Reaction score
61
Location
Mexico
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
 

XouruS

Active Member
Joined
Dec 29, 2009
Messages
941
Best answers
0
Reaction score
36
Location
Canada
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
 

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,716
Best answers
7
Reaction score
283
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
 
OP
Kociii

Kociii

FTW = Fuck The What
Joined
Dec 24, 2009
Messages
543
Best answers
0
Reaction score
1
Location
Sweden
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?
 
OP
Kociii

Kociii

FTW = Fuck The What
Joined
Dec 24, 2009
Messages
543
Best answers
0
Reaction score
1
Location
Sweden
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?!!
 

Santi

Theres no way im stopping
Joined
Aug 29, 2010
Messages
1,975
Best answers
0
Reaction score
149
Location
00
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.
 
OP
Kociii

Kociii

FTW = Fuck The What
Joined
Dec 24, 2009
Messages
543
Best answers
0
Reaction score
1
Location
Sweden
I added it into talkactions/scripts and called bless.lua
 

Mattt

I'm cool I swear
Joined
Apr 28, 2008
Messages
1,163
Best answers
0
Reaction score
7
Location
USA
Did you check your talkactions.xml..that its named bless.lua?
 
OP
Kociii

Kociii

FTW = Fuck The What
Joined
Dec 24, 2009
Messages
543
Best answers
0
Reaction score
1
Location
Sweden
Did you check your talkactions.xml..that its named bless.lua?
Yes i did but it still doesen't work. I put the file in to talkactions/scripts .. and it's still get a error.. :S
 

XouruS

Active Member
Joined
Dec 29, 2009
Messages
941
Best answers
0
Reaction score
36
Location
Canada
did you save it it wordpad or something? Cuz u must do it in a lua editor.
add [email protected]
& i will fix them both in like 3hrs.
 
OP
Kociii

Kociii

FTW = Fuck The What
Joined
Dec 24, 2009
Messages
543
Best answers
0
Reaction score
1
Location
Sweden
did you save it it wordpad or something? Cuz u must do it in a lua editor.
add [email protected]
& i will fix them both in like 3hrs.
Why do i have to add you so you can fix it. My friend just copy the script and put in into his folder. I don't know how but somehow.. :S
 
Top