kito2
www.masteria.net
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?
Can someone make a system like this?
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
if skill == SKILL__LEVEL and newlevel == 80 thenthat?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
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
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
<event type="advance" name="teleportAdvance" event="script" value="script.lua"/>
registerCreatureEvent(cid, "teleportAdvance")
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