• 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+ never get money at !food or !bless

Simonp1512

DBhispano
Joined
Feb 22, 2009
Messages
62
Reaction score
3
hi i'm using tfs 1.3 and i found some scripts on the forum one is for bless and the other is for food gives 100 brown mushroom but always is free xd never get the money from the player, i don't know what is wrong i see the code good

Lua:
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid, 2000) == true then
doPlayerAddItem(cid, 2789, 100)
else
            doPlayerSendCancel(cid, 'You don\'t have enough money for food, poor!!.')
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        end
        end

Lua:
function onSay(cid)

    local player = Player(cid)
    local totalBlessPrice = getBlessingsCost(player:getLevel()) * 5 * 0.7
    if(not(isPlayerPzLocked(cid))) then
    if player:getBlessings() == 5 then
                player:sendCancelMessage("You already have been blessed!", cid)
            elseif player:removeMoney(totalBlessPrice) then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!")
                for b = 1, 5 do
                    player:addBlessing(b, 1)
                end
                player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
             
            else
                player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.", cid)
            end
    else
        player:sendCancelMessage("You can't buy bless while you are in a battle.")
    end
end

pls help
 
Try this...
Lua:
function onSay(player, words, param)
    if player:removeMoney(2000) == true then
        if player:addItem(2789, 100) == true then
            return true
        end      
    else
        player:sendCancelMessage('You don\'t have enough money for food, poor!!.')
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
    end
end
Lua:
function getBlessingsCost(level)
    if level <= 30 then
        return 2000*5
    elseif level >= 120 then
        return 10000*5
    else
        return ((level - 20) * 200 * 5)
    end
end
function onSay(player, words, param)
    local totalBlessPrice = (getBlessingsCost(player:getLevel()) * 5 * 0.7)
    if(player:isPzLocked()) then
        player:sendCancelMessage("You can't buy bless while you are in a battle.")
        return false
    end
    if player:getBlessings() == 5 then
        player:sendCancelMessage("You already have been blessed!")
        return false
    end
    if player:removeMoney(totalBlessPrice) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!")
        for b = 1, 5 do
            player:addBlessing(b, 1)
        end
        player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
    else
        player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.")
    end
end
 
Last edited:
Back
Top