Hello otland.net
I tried to do this script, but i failed, my server down crashed when a player die
So look, i need a script before the player die, if he/she have a storage and is on a configurable area, he/she will be teletransported
to a "x" position with max health and with the effect TELEPORT.
I maked scripts of Statschange bur didn't work, so, someone's can help me?
Here's my ex-script:
Of course, it's on a script onStatsChange
Thanks
I tried to do this script, but i failed, my server down crashed when a player die
So look, i need a script before the player die, if he/she have a storage and is on a configurable area, he/she will be teletransported
to a "x" position with max health and with the effect TELEPORT.
I maked scripts of Statschange bur didn't work, so, someone's can help me?
Here's my ex-script:
Code:
------------Edited Golden Arena------------------
if getPlayerStorageValue(cid, 22545) == 1 then
if getGlobalStorageValue(22550) == 1 then
doBroadcastMessage(getPlayerName(cid) .. " ganó el Evento de Golden arena! Felicidades, has ganado $3.000 y un trofeo de oro!")
doPlayerSendTextMessage(cid, 20, "Eres el último sobreviviente de Golden Arena.")
local goblet = doPlayerAddItem(cid, config.goblet, 1)
doItemSetAttribute(goblet, "description", "Awarded to " .. getPlayerName(cid) .. " for winning the Golden Arena Event.")
doPlayerAddItem(cid, 2152, 30) --premio
setPlayerStorageValue(cid, 22545, 0)
doTeleportThing(cid, posBackGolden)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
setGlobalStorageValue(22550, 0)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
return true
else
doBroadcastMessage(getPlayerName(cid) .. " murió en golden arena! (Restan " .. getGlobalStorageValue(2550) - 1 .. " jugadores dentro del evento).", MESSAGE_STATUS_CONSOLE_ORANGE)
setGlobalStorageValue(22550, getGlobalStorageValue(22550)-1)
setPlayerStorageValue(cid, 22545, 0)
doTeleportThing(cid, posBackGolden)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
return true
end
end
-------------------------------------------
Of course, it's on a script onStatsChange
Thanks