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

small problem with onpreparedeath [creaturescript]

Bvbb

New Member
Joined
Sep 22, 2008
Messages
73
Reaction score
0
Hello Scripters :))
I have problem with that script -.-

Code:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

local arena = getPlayerStorageValue(cid, 2001)

if (arena > 0) then
doPlayerAddHealth(cid, getCreatureMaxHealth(cid), TRUE)
doPlayerAddMana(cid, (getPlayerMaxMana(cid) - getPlayerMana(cid)))
doPlayerAddHealth(killer, getCreatureMaxHealth(killer), TRUE)
doPlayerAddMana(killer, (getPlayerMaxMana(killer) - getPlayerMana(killer)))

Player death and i have warning in console


Ofcourse its not full script :)
 
okey ;p i give some more :p
Code:
local function openArena(arena)
   local wallpos1 = pozycjeAren[arena][3]
   local wallpos2 = pozycjeAren[arena][4]
      doRemoveItem(getThingfromPos(wallpos1).uid, 1)
      doRemoveItem(getThingfromPos(wallpos2).uid, 1)
   doSendMagicEffect(wallpos1, 2)
   doSendMagicEffect(wallpos2, 2)
      return TRUE
end

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

local arena = getPlayerStorageValue(cid, 2001)

if (arena > 0) then
doPlayerAddHealth(cid, getCreatureMaxHealth(cid), FORCE)
doPlayerAddMana(cid, (getPlayerMaxMana(cid) - getPlayerMana(cid)))
doPlayerAddHealth(killer, getCreatureMaxHealth(killer), FORCE)
doPlayerAddMana(killer, (getPlayerMaxMana(killer) - getPlayerMana(killer)))
doCreateItem(3616, 1, pozycjeAren[arena][3]) 
doCreateItem(3616, 1, pozycjeAren[arena][4])

in creaturescript.xml i have
<event type="preparedeath" name="leczenie" script="leczenie.lua"/>
 
Okey now it work..
But.. If u was teleport atack is already and you get a one(last) damage..
and when u kill opponent with ue you get crash...
What i can do now?
 
Back
Top