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

[SOLVED][CreatureEvent] Tile anti death (when die by monsters) TFS 1.1

Hugofasima

Website: thenosegang.servegame.com
Joined
Jun 24, 2015
Messages
206
Reaction score
23
I want to make an Arena where players can die by players and monsters without worries.

When they die, they are teleported to a specific location, and so, enter the arena again!


Please guys!!! The Pvp tool does not work when you die for a monster on TFS 1.1...
 
dont register in login and dont forget to remove Pvp tool from map editor

in creaturescripts.xml put this code
Code:
<event type="login" name="Arena_Login" script="Arena_Death.lua"/>
<event type="preparedeath" name="Arena_Death" script="Arena_Death.lua"/>
make file name Arena_Death.lua and put this code
Code:
function onLogin(cid)
cid:registerEvent("Arena_Death")
return true
end

local arena = {
     from = {x=1590, y=1809, z=7}, -- left top corner of  arena
     to = {x=1669, y=1867, z=7}, -- right bottom corner of  arena
     temple = { x = 2000, y = 2000, z = 7 } -- change it to temple pos

}
function onPrepareDeath(cid, killer)
    if isInRange(getPlayerPosition(cid), arena.from,arena.to) then
        if isPlayer(cid) then
            Player(cid):addHealth(Player(cid):getMaxHealth())
            Player(cid):addMana(Player(cid):getMaxMana())
            doTeleportThing(cid,arena.temple)
            return false
        end
    end
   return true
end

This script won't work in TFS 1.1.
 
Back
Top