robertorb12
New Member
- Joined
- Jan 15, 2020
- Messages
- 65
- Reaction score
- 3
the drowning effect never disappears, need to log out to remove
im using tfs 1.3
i use this script: Drowning.lua in movements
please help
im using tfs 1.3
i use this script: Drowning.lua in movements
Code:
local condition = Condition(CONDITION_DROWN)
condition:setParameter(CONDITION_PARAM_PERIODICDAMAGE, -20)
condition:setParameter(CONDITION_PARAM_TICKS, -1)
condition:setParameter(CONDITION_PARAM_TICKINTERVAL, 2000)
function onStepIn(creature, item, position, fromPosition)
if creature:isPlayer() then
if math.random(1, 10) == 1 then
position:sendMagicEffect(CONST_ME_BUBBLES)
end
creature:addCondition(condition)
end
return true
end
function onStepOut(creature, item, position, fromPosition)
if not creature:isPlayer() then
creature:removeCondition(CONDITION_DROWN)
end
return true
end