• 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.
 
Looks like you need to do a script that checks all players health all the time, and when it drops below 10% then send a message. It will cause a rather huge increase in server load. As far as I know.
 
hmm try this and remember to register it
Code:
function onStatsChange(cid, attacker, type, combat, value)
    if getCreatureMaxHealth(cid)*0.1 <= getCreatureHealth(cid) then
        doCreatureSay(cid, 'Finish Him!', TALKTYPE_MONSTER) 
    end
    return true
end
 
^up remember, monsters, players..
LUA:
function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) and isPlayer(attacker) and getCreatureMaxHealth(cid)*0.1 <= getCreatureHealth(cid) then
        doCreatureSay(cid, 'Finish Him!', TALKTYPE_MONSTER) 
    end
    return true
end

function onLogin(cid)
	registerCreatureEvent(cid, "finishim")
	return true
end

XML:
<event type="statschange" name="finishim" event="script" value="finish.lua"/>
<event type="login" name="finish" event="script" value="finish.lua"/>
 
Last edited:
Code:
getCreatureMaxHealth[B](cid)[/B]*0.1 <= getCreatureHealth[B](cid)[/B] then
        doCreatureSay[B](cid,[/B] 'Finish Him!', TALKTYPE_MONSTER)

That's set up properly unless I'm mistaken
 
oops
LUA:
function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) and isPlayer(attacker) and getCreatureHealth(cid) <= getCreatureMaxHealth(cid)*0.1 and combat ~= 128 or type == 1 then
        doCreatureSay(cid, 'Finish Him!', TALKTYPE_MONSTER) 
    end
    return true
end
 
function onLogin(cid)
    registerCreatureEvent(cid, "finishim")
    return true
end
 
If its not too much, could it check sex so if it's female, it says Finish Her!
And it's still spamming Finish Him! even if you get hit o.o
 
lol right i forgot :p

LUA:
function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) and isPlayer(attacker) and getCreatureHealth(cid) <= getCreatureMaxHealth(cid)*0.1 and combat ~= 128 or type == 1 then
        doCreatureSay(cid, getPlayerSex(cid) == 0 and 'Finish Her!' or 'Finish Him!', TALKTYPE_MONSTER) 
    end
    return true
end
 
function onLogin(cid)
    registerCreatureEvent(cid, "finishim")
    return true
end
 
60 seconds exhaustion..
LUA:
local exhaustTime = 60
local exhaustStorage = 1020

function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) and isPlayer(attacker) and getCreatureHealth(cid) <= getCreatureMaxHealth(cid)*0.1 and combat ~= 128 or type == 1 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
    return true
end
 
function onLogin(cid)
    registerCreatureEvent(cid, "finishim")
    return true
end
 
globalevent
LUA:
function onThink(interval)
	for _,cid in ipairs(getPlayersOnline()) do
		if getCreatureHealth(cid) <= getCreatureMaxHealth(cid)*0.1 then
			doSendAnimatedText(getThingPos(cid),(getPlayerSex(cid) == 0 and "Kill her" or "Kill him"), TEXTCOLOR_RED)
		end
	end
return true
end
 
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)) 
            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
 
Back
Top