Well, im using a script for a PVP arena and every time a player get killed by a field item (inside the arena) my server crash.
The Script:
Can someone help me to fix this? =X
@Edit:
The bug happen only when the player die to the condition (burning, poisoned, etc...), not when he steps on the field item and lose some hp.
Example:
11:50 You lose 20 hitpoints. (steping on a fire field, if the player get killed by this the server wont crash)
11:53 You lose 10 hitpoints. (condition burning, if the player get killed by this the server will crash)
The Script:
Code:
local ArenaJungle = { frompos = {x=1908,y=1208,z=7}, topos = {x=1992,y=1290,z=7} }
local ArenaJungleSub = { frompos = {x=1908,y=1208,z=8}, topos = {x=1992,y=1290,z=8} }
local ArenaCity = { frompos = {x=1871,y=1298,z=7}, topos = {x=1920,y=1342,z=7} }
local TemploArenas = {x = 1296, y = 1330, z = 6}
function onStatsChange(cid, attacker, type, combat, value)
if isInRange(getCreaturePosition(cid), ArenaJungle.frompos, ArenaJungle.topos) or isInRange(getCreaturePosition(cid), ArenaJungleSub.frompos, ArenaJungleSub.topos) or isInRange(getCreaturePosition(cid), ArenaCity.frompos, ArenaCity.topos) then
if type == 1 then
if getCreatureHealth(cid) <= value then
if isPlayer(cid) then
doSendMagicEffect(TemploArenas, 10)
doTeleportThing(cid, TemploArenas, true)
doRemoveConditions(cid)
if getCreatureCondition(cid, CONDITION_POISON) then
doRemoveCondition(cid, CONDITION_POISON)
end
if getCreatureCondition(cid, CONDITION_FIRE) then
doRemoveCondition(cid, CONDITION_FIRE)
end
if getCreatureCondition(cid, CONDITION_ENERGY) then
doRemoveCondition(cid, CONDITION_ENERGY)
end
if getCreatureCondition(cid, CONDITION_PARALYZE) then
doRemoveCondition(cid, CONDITION_PARALYZE)
end
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), true)
end
return false
end
end
end
return true
end
Can someone help me to fix this? =X
@Edit:
The bug happen only when the player die to the condition (burning, poisoned, etc...), not when he steps on the field item and lose some hp.
Example:
11:50 You lose 20 hitpoints. (steping on a fire field, if the player get killed by this the server wont crash)
11:53 You lose 10 hitpoints. (condition burning, if the player get killed by this the server will crash)
Last edited: