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

need a arena script, rep++

chauffaille

New Member
Joined
Sep 10, 2009
Messages
198
Reaction score
1
hello.

I need a script for when a player dies in the arena, he is teleported to another place,

but not die, when your life to get to 0 to be teleported him to a place

as if it were an arena

thanks
 
pls 0.3.6

Code:
  local arena = {
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
}

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
        if isPlayer(cid) == TRUE then
                if isInArea(getCreaturePosition(cid), arena.frompos, arena.topos) then
                        doPlayerAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE)
                        doTeleportThing(cid, arena.exit)
                        doSendMagicEffect(arena.exit, 10)
                end
                return true
        end
end

wont work anymore :(

Nips
 
Code:
local arena = {
	from = {x=51, y=296, z=7}, -- Top Left Corner
	to = {x=83, y=310, z=7}, -- Bottom Right Corner
	exit = {x=67, y=290, z=6} -- Exit
    }

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) == true then
        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)
        end
        return true
    end
end
 
if player got kicked the script do not add health again :s

why ??


Code:
[22/12/2009 10:47:42] [Error - CreatureScript Interface] 
[22/12/2009 10:47:42] data/creaturescripts/scripts/arena2.lua:onPrepareDeath
[22/12/2009 10:47:42] Description: 
[22/12/2009 10:47:42] data/lib/position.lua:2: attempt to index local 'fromPos' (a nil value)
[22/12/2009 10:47:42] stack traceback:
[22/12/2009 10:47:42] 	data/lib/position.lua:2: in function 'isInArea'
[22/12/2009 10:47:42] 	data/creaturescripts/scripts/arena2.lua:9: in function <data/creaturescripts/scripts/arena2.lua:7>
 
Last edited:
now im using this script:

Code:
local arena = {
	from = {x=51, y=296, z=7}, -- Top Left Corner
	to = {x=83, y=310, z=7}, -- Bottom Right Corner
	exit = {x=67, y=290, z=6} -- Exit
    }

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) == true then
        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)
        end
        return true
    end
end


and it still don't work ...
an i dont chaned anything :s
 
Back
Top