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

Lua How does one cure conditions with an action script?

Sizaro

Advanced OT User
Joined
Aug 20, 2007
Messages
5,172
Solutions
5
Reaction score
227
Location
Sweden
GitHub
coldensjo
LUA:
local conditions = {
            CONDITION_POISON,
            CONDITION_BLEEDING,
            CONDITION_FIRE,
            CONDITION_ENERGY,
            CONDITION_CURSED,
            CONDITION_DRUNK,
            CONDITION_INVISIBLE,
            CONDITION_PARALYZE,
            CONDITION_REGENERATION,
            CONDITION_ATTRIBUTES,
            CONDITION_MANASHIELD,
            CONDITION_HASTE
            }
I need to create an action that cures all these conditions, I can't seem to figure out how.
 
Solution
should be something like this
LUA:
for _, conditionType in ipairs(conditions) do
    if player:getCondition(conditionType) then
        player:removeCondition(conditionType)
    end
end
Code:
local conditions = {CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY, CONDITION_BLEEDING, CONDITION_DROWN, CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED}
for i = 1, #conditions do
    player:removeCondition(conditions[i])
end
 

Similar threads

Back
Top