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

Finish Him! when below 10% health

Nightimarez

New Member
Joined
Jul 24, 2008
Messages
287
Reaction score
2
I'd like a script that says Finish Him! in red letters above the player when he is below 10% health.
 
[09/10/2010 12:59:29] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/finish.lua:4: 'then' expected near 'if'
[09/10/2010 12:59:29] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/finish.lua)
[09/10/2010 12:59:29] data/creaturescripts/scripts/finish.lua:4: 'then' expected near 'if'
[09/10/2010 12:59:29] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/finish.lua:4: 'then' expected near 'if'
[09/10/2010 12:59:29] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/finish.lua)
[09/10/2010 12:59:29] data/creaturescripts/scripts/finish.lua:4: 'then' expected near 'if'
 
LUA:
local exhaustTime = 60
local exhaustStorage = 1020

function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) and isPlayer(attacker) and type == 1 then
        if getCreatureHealth(cid) <= math.floor((getCreatureMaxHealth(cid)*0.10)) then
            if exhaustion.check(cid, exhaustStorage) then
                return true
            else
                exhaustion.set(cid, exhaustStorage, exhaustTime)
                doCreatureSay(cid, getPlayerSex(cid) == 0 and 'Finish Her!' or 'Finish Him!', TALKTYPE_MONSTER) 
            end
        end
    end
    return true
end
 
function onLogin(cid)
    registerCreatureEvent(cid, "finishim")
    return true
end
 
well I can make Flawless victory, if attacker has full health
now for Fatality, which would be the conditions? O_0
 
Lets say I kill someone, then Fatality should appear over my character so people know I'm the one that killed him. And as for Flawless victory, that would be too much because players usually have magic shield on. Thank you very much tho, not gonna bother you anymore. You've done enough.
 
LUA:
local exhaustTime = 60
local exhaustStorage = 1020

function onKill(cid, target, lastHit)
    if isPlayer(cid) and isPlayer(target) and lastHit then
        doCreatureSay(cid, 'FATALITY', TALKTYPE_MONSTER)
        if getCreatureHealth(cid) >= getCreatureMaxHealth(cid) then
            addEvent(doCreatureSay, 2000, 'Flawless Victory', TALKTYPE_MONSTER)
        end
    end
    return true
end

function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) and isPlayer(attacker) and type == 1 then
        if getCreatureHealth(cid) <= math.floor((getCreatureMaxHealth(cid)*0.10)) then
            if exhaustion.check(cid, exhaustStorage) then
                return true
            else
                exhaustion.set(cid, exhaustStorage, exhaustTime)
                doCreatureSay(cid, getPlayerSex(cid) == 0 and 'Finish Her!' or 'Finish Him!', TALKTYPE_MONSTER) 
            end
        end
    end
    return true
end
 
function onLogin(cid)
    registerCreatureEvent(cid, "finishim")
    registerCreatureEvent(cid, "flawless")
    return true
end
XML:
<event type="kill" name="flawless" event="script" value="finish.lua"/>
<event type="statschange" name="finishim" event="script" value="finish.lua"/>
<event type="login" name="finish" event="script" value="finish.lua"/>
 
Back
Top