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

Lua PVP Town

Rexanilator

New Member
Joined
Oct 3, 2009
Messages
297
Reaction score
2
I am looking for a script so that when a person dies in my pvp town that they will be tp'd back to the temple of the pvp town and not back to the main town temple.

Rep for help!!!
 
Man i guess u can swim to this city on boat? so use setPlayerStorageValue(cid, xxxx) under this this pvp city and
setPlayerStorageValue(cid, zzzz) under another city to switch off tp's

in the npc script
and then add this script to creature scripts :) use prepare death to register it in xml
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
storage = getPlayerStorageValue(cid, xxxx)
if(storage > 0 and getGlobalStorageValue(storage) == cid) then -- is in city
doTeleportThing(cid, {x=1066,y=1244,z=6}, TRUE)
end
return true
end
 
Man i guess u can swim to this city on boat? so use setPlayerStorageValue(cid, xxxx) under this this pvp city and
setPlayerStorageValue(cid, zzzz) under another city to switch off tp's

in the npc script
and then add this script to creature scripts :) use prepare death to register it in xml
or isinrange, which saves us from using storages

Lua:
local fromPos = {x=100, y=100, z=100}
local toPos = {x=1000, y=1000, z=1000}

function onPrepareDeath(cid, deathList)
    if isInRange(getCreaturePosition(cid), fromPos, toPos) then
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
        doCreatureAddMana(cid, getCreatureMaxMana(cid)-getCreatureMana(cid))
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))
    end
return true
end
 
Back
Top