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

TFS 1.X+ !bless talkaction doesn't work

Hofedar543

New Member
Joined
Aug 10, 2021
Messages
2
Reaction score
0
Hello,

I have a problem with !bless talkactions script (I'm using newest TFS 1.3)

XML:
<talkaction words="!bless" script="bless.lua"/>

Lua:
local bless = {1, 2, 3, 4, 5}
local price_bless = 10000

function onSay(player, words, param)

    for i = 1, table.maxn(bless) do
        if player:hasBlessing(bless[i]) then
            player:sendCancelMessage("You already have all blessings.")
            player:getPosition():sendMagicEffect(CONST_ME_POFF)
            return false
        end
    end

    if player:removeMoney(price_bless) 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.")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
    end
   
    return true
end

It takes money from player, but do not gives any blessings.

Error in console:

1629095530670.png

@edit

I'm using Ubuntu 20.04
 
Last edited:
try this one;
 
try this one;

Same error :(

1629095530670.png
 
Back
Top