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)
It takes money from player, but do not gives any blessings.
Error in console:
@edit
I'm using Ubuntu 20.04
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:
@edit
I'm using Ubuntu 20.04
Last edited: