jestem pro
That is the question
- Joined
- Apr 20, 2013
- Messages
- 650
- Solutions
- 14
- Reaction score
- 87
Hello, I have a little problem with onLogin function.
Generally I wanna add player for example 5 shield skill. There is a part in "actions", which add the skill for 30 sec.
But when player relog the skill is being reseted. It's made by createConditionObject:
The explanation:
When player use an item it adds him +5 shield skill for 30 sec. Then if player relog the skill should be added for as many seconds as it was left.
Any suggestions how we can solve it or make in other way?
Generally I wanna add player for example 5 shield skill. There is a part in "actions", which add the skill for 30 sec.
But when player relog the skill is being reseted. It's made by createConditionObject:
Lua:
local storage = 12347
local checkingskill
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, 5)
setConditionParam(condition, CONDITION_PARAM_TICKS, checkingskill * 1000)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
function onLogin(cid)
if getCreatureStorage(cid, storage) > os.time() then
checkingskill = getCreatureStorage(cid, storage) - os.time()
doAddCondition(cid, condition)
end
return true
end
The explanation:
When player use an item it adds him +5 shield skill for 30 sec. Then if player relog the skill should be added for as many seconds as it was left.
Any suggestions how we can solve it or make in other way?