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?
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"/>