• Congratulations to the OTLand January Mapping Competition Winner! The grand prize of Otland Premium goes to Andréew.
  • Sign up for February Mapping Competition! The prize includes Otland Premium time.
  • 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!

Lua [TFS 1.3][HELP] - Frag Reward

dredwan

New Member
Joined
Feb 9, 2013
Messages
10
Best answers
0
Reaction score
1
I want to make a Server War with the classic script for war: "reward for killing players", but in my sever console, there's not error and the gameserver there's not rewardfrag...
How to fix it?

Code:
function onKill(cid, target, lastHit)

    local attackPlayer = Player(target)

    local reward = {
            item = 2152,
            count = 2
            }

    if not attackPlayer then
        return true
    end

    for id, damage in pairs(attackPlayer:getDamageMap()) do
        local player = Player(id)
        if player then
            if player:getIp() ~= target:getIp() then
                local experience = attackPlayer:getExperience()
                local expFormula = (experience * expMultiplier)
                local bonusExpFormula = (experience * bonusExpMultiplier)
                player:addExperience(math.floor(expFormula), true)
                player:addItem(item, count)
            end
        end
    end
end



<event type="kill" name="FragReward" script="fragreward.lua"/>
 
Top