• 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 Bless - aol Help!

yoiker

Member
Joined
Jan 21, 2012
Messages
194
Solutions
1
Reaction score
9
Hi users, I need someone to make me a script and aol bless " not together " separated from each other.
I use tfs 1.0 I have tried all the talkaction of blessings and all give me error; doPlayerRemoveMoney, doPlayerAddBlessing and doPlayerSendCancel. The same goes with aol, only that it is error doPlayerRemoveMoney.
Please help :D
 
Errors: doPlayerRemoveMoney, doPlayerAddBlessing and doPlayerSendCancel.

Aol
Code:
function onSay(cid, words, param)

if player:removeMoney(cid, 20000) == TRUE then
local bp = doPlayerAddItem(cid, 2173, 1)
doCreatureSay(cid, "You received an Amulet of Loss.", TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, "You dont have enought money, you need 20k.", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end

Bless
Code:
local bless = {1, 2, 3, 4, 5}
local cost = 50000 -- Cost in gp.

function onSay(cid, words, param)
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless)) then
doPlayerSendCancel(cid, "You already have all blessings.")
return TRUE
end
end

if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless)
end
doPlayerSendTextMessage(cid,24, "You have bought all blessings.")
doSendMagicEffect(getPlayerPosition(cid), 28)
else
doPlayerSendCancel(cid, "You don't have enough money.")
end
return TRUE
end
 
Code:
function onSay(cid, words, param)
     local player = Player(cid)
     if player:removeMoney(20000) then
         player:addItem(2173, 1)
         player:say("You received an Amulet of Loss.", TALKTYPE_ORANGE_1)
     else
         player:say("You dont have enought money, you need 20k.", TALKTYPE_ORANGE_1)
         player:getPosition():sendMagicEffect(CONST_ME_POFF)
     end
     return true
end
Code:
local bless = {1, 2, 3, 4, 5}
local cost = 50000 -- Cost in gp.

function onSay(cid, words, param)
     local player = Player(cid)
     for i = 1, table.maxn(bless) do
         if player:hasBlessing(bless[i]) then
             return player:sendCancelMessage("You already have all blessings.")
         end
     end

     if player:removeMoney(cost) then
         for i = 1, table.maxn(bless) do
             player:addBlessing(bless[i])
         end
         player:sendTextMessage(MESSAGE_INFO_DESCR, "You have bought all blessings.")
         player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
     else
         player:sendCancelMessage("You don't have enough money.")
     end
     return true
end
 
@Limos Im getting debug when im using !aol :/ !bless works perfect!

When a player says !aol he will get debug but when he logs in again he does have the aol and he lost the 1 cc (I changed it to 1cc instead of 2cc)

data\talkactions\talkactions.xml
PHP:
    <talkaction words="!aol" script="aol.lua"/>

data\talkactions\scripts\aol.lua
PHP:
function onSay(cid, words, param)
     local player = Player(cid)
     if player:removeMoney(10000) then
         player:addItem(2173, 1)
         player:say("You received an Amulet of Loss.", TALKTYPE_ORANGE_1)
     else
         player:say("You dont have enought money, you need 1cc (10k).", TALKTYPE_ORANGE_1)
         player:getPosition():sendMagicEffect(CONST_ME_POFF)
     end
     return true
end
 
Back
Top