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

Lua Add own condition value inside onLogin?

Acubens

Old Penguin
Joined
May 6, 2008
Messages
1,303
Solutions
15
Reaction score
218
Location
Venezuela
I dont find the method to put this to work, i created function outside onLogin but is the same, it says "condition parameters only can be loaded with the script"

LUA:
local conditionMaxHealth = createConditionObject(CONDITION_ATTRIBUTES)
    setConditionParam(conditionMaxHealth, CONDITION_PARAM_SUBID, 650)
    setConditionParam(conditionMaxHealth, CONDITION_PARAM_TICKS, -1)

function onLogin(cid)
    local variableHealth = (getPlayerLevel(cid) * 50)
    setConditionParam(conditionMaxHealth, CONDITION_PARAM_STAT_MAXHITPOINTS, variableHealth)
    doAddCondition(cid, conditionMaxHealth)
end

Suggestions please xD
 
Last edited:
I dont find the method to put this to work, i created function outside onLogin but is the same, it says "condition parameters only can be loaded with the script"

LUA:
local conditionMaxHealth = createConditionObject(CONDITION_ATTRIBUTES)
    setConditionParam(conditionMaxHealth, CONDITION_PARAM_SUBID, 650)
    setConditionParam(conditionMaxHealth, CONDITION_PARAM_TICKS, -1)
    doAddCondition(cid, conditionMaxHealth)

function onLogin(cid)
    local variableHealth = (getPlayerLevel(cid) * 50)
    setConditionParam(conditionMaxHealth, CONDITION_PARAM_STAT_MAXHITPOINTS, variableHealth)
    doAddCondition(cid, conditionMaxHealth)
end

Suggestions please xD
Did you restart server, or try to use /reload?

Cuz I installed your code and it worked no problem.
 

Similar threads

Back
Top