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

script from 0.3.5 to 0.3.6

nips

Da.Nb
Joined
Oct 15, 2009
Messages
152
Reaction score
0
Location
Germany
Hi all,
can some one fix this script for me ??

it's not working on tfs 0.3.6

Code:
  local arena1 = {
frompos = {x=51, y=296, z=7}, -- Top Left Corner
topos = {x=83, y=310, z=7}, -- Bottom Right Corner
exit = {x=67, y=290, z=6} -- Exit
}
local arena2 = {
frompos = {x=34, y=238, z=7}, -- Top Left Corner
topos = {x=72, y=263, z=7}, -- Bottom Right Corner
exit = {x=54, y=265, z=7} -- Exit
}
local arena3 = {
   fromPos = { x=120, y=33, z=9 }, -- Top Left Corner of Arena
   toPos = { x=132, y=43, z=9 }, -- Bottom Right Corner of Arena
   exit = { x=126, y=33, z=9 }, -- Kick
   tpPos = { x=126, y=36, z=9 }, -- Tele
   time = 30
}

local function deleteTeleport()
   local tpCheck = getTileItemById(arena.tpPos, 1387).uid
   if(tpCheck > 0) then
      doRemoveItem(tpCheck)
      doSendMagicEffect(arena.tpPos, CONST_ME_POFF)
   end
end


function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) == true then
      local arena = arena1
        if isInArea(getCreaturePosition(cid), arena.from, arena.to) then
            doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), true)
            doTeleportThing(cid, arena.exit)
            doSendMagicEffect(arena.exit, CONST_ME_ENERGY)
         return false
        end
      arena = arena2
      if isInArea(getCreaturePosition(cid), arena.from, arena.to) then
            doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), true)
            doTeleportThing(cid, arena.exit)
            doSendMagicEffect(arena.exit, CONST_ME_ENERGY)
         return false
        end
      arena = arena3
        if isInArena(getCreaturePosition(cid), arena.from, arena.to) then
         doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE)
         doTeleportThing(cid, arena.exit)
         doSendMagicEffect(arena.exit, CONST_ME_ENERGYAREA)
         doCreateTeleport(1387, arena.exit, arena.tpPos)
         addEvent(deleteTeleport, arena.time * 1000)
         return false
        end
    end
      return true
end

creaturescript.xml:
Code:
<event type="preparedeath" name="Arena1" script="arena.lua"/>


login.lua:
Code:
registerCreatureEvent(cid, "Arena")

There are no errors :s
 
why doesn't it work in prepareDeath but it works in any actions?

I kinda need it too.. else I'll have to play in sources and I hate doing that >:[
 
Back
Top