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

Last Hit Boss

creatserver

New Member
Joined
Feb 7, 2015
Messages
25
Reaction score
0
Wanted to put in this script to win whoever gives the last hit.

Lua:
local config = {
storagekill = 19500,
storageaegis = 19332,
tempo = 5,
times = 1, --- quantidade de vezes que tenho que matar
charges = 1,
effect1 = 66,
effect2 = 10
}

function onKill(cid, target, lastHit)
    local killed = getPlayerStorageValue(cid,config.storagekill) < 0 and 0 or getPlayerStorageValue(cid,config.storagekill)
    local skill = getPlayerStorageValue(cid, config.storageaegis)

    if isMonster(target) and getCreatureName(target):lower() == 'aegis' then
        if killed + 1 < config.times then
            doCreatureSay(target, "I'll be back mortal...", 20)
            doSendMagicEffect(getCreaturePosition(target), config.effect1)
            setPlayerStorageValue(cid, config.storagekill, killed + 1)
            addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2)
            addEvent(doCreateMonster, 1000*config.tempo, "Aegis", getCreaturePosition(target), true)
        elseif killed + 1 >= config.times then
            setPlayerStorageValue(cid, config.storagekill, 0)
            if skill < config.charges then
                doPlayerSendTextMessage(cid,22,"Congratulations, you just killed "..getCreatureName(target).." and earned Aegis of Immortal skill!")
                doBroadcastMessage("O jogador ".. getCreatureName(cid) .." absorveu a special skill Aegis of the Immortal ao desferir o último golpe no BOSS Aegis.", 26)
                setPlayerStorageValue(cid, config.storageaegis, config.charges)
                zEffect(cid, 37)
            end
        end
    end
return true
end
 
Last edited by a moderator:
use
Lua:
function onDeath(cid, corpse, killer, mostDamageKiller)
and give the reward to "killer"
 
Last edited by a moderator:
Okay, so what's the request?

Friend because this script when the player kills the boss, everyone I've been helping wins. And the right wins what gives the last hit.

use
Code:
function onDeath(cid, corpse, killer, mostDamageKiller)
and give the reward to "killer"

It has to be recreate the script for me using the function onDeath(cid, corpse, killer, mostDamageKiller), because I tried and I could not and I'm also a beginner in scripter
 
Back
Top