• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Spell - Buffs

adamox223

New Member
Joined
Oct 21, 2017
Messages
100
Reaction score
4
Hello i made this script, and i dont know how to add:

When spell is active (Buff ON) then this spell remove -5% health per seconds, can you help me?

Code:
local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_EFFECT, 8)
    setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
    setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
    setConditionParam(condition, CONDITION_SPEED, 25)
    setCombatCondition(combat, condition)

local function healthCheck(cid)
    player.add(cid)
    if isPlayer(player:get()) and getCreatureCondition(player:get(), CONDITION_ATTRIBUTES) then
        if player:health() > player:healthMax()/200 then
            player:health(-player:healthMax()/200, true, false)
            addEvent(healthCheck, 1000, player:get())
            return true
        else
            doRemoveCondition(player:get(), CONDITION_ATTRIBUTES)
        end
    end
return false
end

function onCastSpell(cid, var)
    if not getCreatureCondition(cid, CONDITION_ATTRIBUTES) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Buff On")
        doCombat(cid, combat, var)
        healthCheck(cid)
    else
        doRemoveCondition(cid, CONDITION_ATTRIBUTES)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Buff Off")
        stopEvent(healthCheck)
        return false
    end
return true
end
 
Back
Top