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

Reaching x level = send to x,y,z location and n town id

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,766
Solutions
1
Reaction score
225
Location
Chile, Santiago
Light topic name says, when players reach level 80 for example, it teleports to x, y, z and makes him resident of a n town id.

Can someone make a system like this?
 
PHP:
function onAdvance(cid, skill, oldlevel, newlevel)
   if skill == SKILL__LEVEL and newlevel == 80 then
      local newPos = {x=100,y=100,z=100}
      doPlayerSetTown(cid, TOWNID)
      doTeleportThing(cid,newPos)
   end
   return TRUE
end

that?
 
Last edited:
@up
it's not for level 80 ;x

PHP:
function onAdvance(cid, skill, oldlevel, newlevel)
   if skill == SKILL__LEVEL then
      local newPos = {x=100,y=100,z=100}
      doPlayerSetTown(cid, TOWNID)
      doTeleportThing(cid,newPos)
   end
   return TRUE
end
that?
if skill == SKILL__LEVEL and newlevel == 80 then
 
oh right my bad <.<
blame the time, 2 AM xD

PHP:
function onAdvance(cid, skill, oldlevel, newlevel)
   if skill == SKILL__LEVEL and newlevel == 80 then
      local newPos = {x=100,y=100,z=100}
      doPlayerSetTown(cid, TOWNID)
      doTeleportThing(cid,newPos)
   end
   return TRUE
end

there :p
 
Lua:
local cfg =
{
    level = 100,
    townPos = {x=100, y=100, z=7}
}

function onAdvance(cid, skill, newLevel)
   if skill == SKILL__LEVEL and newLevel == cfg.level then
      doTeleportThing(cid, cfg.townPos)
   end
   return TRUE
end
 
data/creaturescripts/scripts/script.lua

data/creaturescripts/creaturescripts.xml
PHP:
<event type="advance" name="teleportAdvance" event="script" value="script.lua"/>

data/creaturescripts/scripts/login.lua
PHP:
registerCreatureEvent(cid, "teleportAdvance")
 
Nice, gonna test it... Im wondering that if could you made something similar, but when players gets downgrowded from level 6 to 5 and have vocation, it teleports to x, y, z and set town id n and set maxhp and hp to 150 and maxmp and mp to 0, skills to 10, ml t 0, remove vocation and set level 1... like a rook system.

It is possible?

PD: Also repped.
 
Lua:
local cfg =
{
    old = 6,
    new = 5,
    rook = {x=100, y=100, z=7}
}

function onAdvance(cid, skill, oldlevel, newlevel)
    local name = getCreatureName(cid)
    if skill == SKILL__LEVEL and oldlevel < cfg.old and newlevel > cfg.new then
        doBroadcastMessage("" .. name .. " has been sent to rookguard!", MESSAGE_STATUS_CONSOLE_RED)
	doTeleportThing(cid, cfg.rook)
    return TRUE
    end
end
 
Back
Top