some players report that they get infinite pzlocked, so I thought about it ...
but don't work =x
but don't work =x
Lua:
function onThink(player)
local fightCondition = player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT)
if fightCondition == nil then
if fightCondition:getTicks(configManager.getNumber(configKeys.PZ_LOCKED) > 900000) then
player:removeCondition(CONDITION_INFIGHT)
print(math.floor(fightCondition:getTicks() / 1000))
end
end
return true
end
Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/custom/removepk.lua:onThink
data/creaturescripts/scripts/custom/removepk.lua:4: attempt to index local 'fightCondition' (a nil value)
stack traceback:
[C]: in function '__index'
data/creaturescripts/scripts/custom/removepk.lua:4: in function <data/creaturescripts/scripts/custom/removepk.lua:1>