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

movements script problem

mmheo

New Member
Joined
Sep 14, 2017
Messages
157
Reaction score
1
hello i have this script but when player StepIn items server crash anyone can tell me why
Code:
function onStepIn(cid, item, pos)
    if(isPlayer(cid)) then
        local top = getCreatureMaxHealth(cid) / 3
        if(item and item.uid > 0 and getItemAttribute(item.uid, "aid") and getItemAttribute(item.uid, "aid") == 13111) then
            doItemEraseAttribute(item.uid, "aid")
        end
        doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -1, -top, CONST_ME_EXPLOSIONAREA)
    end
    
    return true
end
0.4
 
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if isPlayer(cid) then
        doItemEraseAttribute(item.uid, "aid")
        local top = getCreatureMaxHealth(cid) / 3
        doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -1, -top, CONST_ME_EXPLOSIONAREA)
    end
    return true
end
 
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if isPlayer(cid) then
        doItemEraseAttribute(item.uid, "aid")
        local top = getCreatureMaxHealth(cid) / 3
        doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -1, -top, CONST_ME_EXPLOSIONAREA)
    end
    return true
end
same problem when player stepin server crash :S
 
@mmheo Just tested @cbrm 's code and it worked. No crash.
TFS 0.4 REV 3777

When does it crash in your case? Provide more information.
when player stepin items action 41541 server get crash idk why and this is my movement.xml
<movevent type="StepIn" actionid="41541" event="script" value="losse.lua"/>

the problem is here
doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -1, -top, CONST_ME_EXPLOSIONAREA)

maybe not work with movements :S @Snavy
 
Last edited:
Back
Top