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

teleport

Solution
at creaturescripts.xml add
Lua:
<event type="kill" name="CreateTP" script="createteleport.lua"/>
at creaturescripts/scripts/login.lua add
Code:
registerCreatureEvent(cid, "CreateTP")
add new lua in your creaturescripts/scripts/createteleport.lua add
Code:
local config = {
   ["Rat"] = {time = 60, toPos = {x = 1000, y = 1000, z = 7}, tpPos = {x = 2000, y = 2000, z = 7}}
}
local function deleteTeleport(tp)
   local teleport = getTileItemById(tp, 1387).uid
   if(teleport > 0) then
     doRemoveItem(teleport)
     doSendMagicEffect(tp, CONST_ME_POFF)
   end
   return true
end

function onKill(cid, target)
   local monster = config[getCreatureName(target):lower()]

   if(isPlayer(target) or not monster) then
     return true
   end...
at creaturescripts.xml add
Lua:
<event type="kill" name="CreateTP" script="createteleport.lua"/>
at creaturescripts/scripts/login.lua add
Code:
registerCreatureEvent(cid, "CreateTP")
add new lua in your creaturescripts/scripts/createteleport.lua add
Code:
local config = {
   ["Rat"] = {time = 60, toPos = {x = 1000, y = 1000, z = 7}, tpPos = {x = 2000, y = 2000, z = 7}}
}
local function deleteTeleport(tp)
   local teleport = getTileItemById(tp, 1387).uid
   if(teleport > 0) then
     doRemoveItem(teleport)
     doSendMagicEffect(tp, CONST_ME_POFF)
   end
   return true
end

function onKill(cid, target)
   local monster = config[getCreatureName(target):lower()]

   if(isPlayer(target) or not monster) then
     return true
   end
   doCreateTeleport(1387, monster.toPos, monster.tpPos)
   doCreatureSay(cid, "You have "..monster.time.." seconds to enter the teleport!", TALKTYPE_ORANGE_1)
   addEvent(deleteTeleport, monster.time * 1000, monster.tpPos)
   return true
end
 
Solution
Back
Top