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.
<event type="statschange" name="finishim" event="script" value="finish.lua"/>
<event type="login" name="finish" event="script" value="finish.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
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
<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"/>