• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Request] CreatureScript not hard to make - Please read it

Nubaza

LUA Scripter
Joined
Jun 5, 2011
Messages
337
Solutions
1
Reaction score
23
Location
Chile
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:

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 :D
 
Back
Top