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

Solved Monster Portal

Powtreeman

Member
Joined
Sep 26, 2011
Messages
400
Reaction score
6
Location
USA
I have this monster portal transfered from my 9.6 server to my 1.0 but it doesn't work. No errors or anything but here it is.

Code:
local config = {
  ["ferumbras"] = {time = 60, toPos = {x = 1000, y = 1000, z = 7}, tpPos = {x = 915, y = 1096, z = 0}}
}
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
 
Code:
<event type="kill" name="Test" script="test.lua"/>
Code:
player:registerEvent("Test")

Make sure you add things correctly in creaturescripts.xml and register it in login as well.
 
Code:
 player:registerEvent("CreateTeleport")
   [code/] in login

[code] <event type="kill" name="CreateTeleport" script="createteleport.lua"/> [code/]
in creaturescripts.xml

and the script where it should be

ah ok its making this error.

heres my notrash script
Code:
function onAddItem(moveitem, tileitem, position)
   if (tileitem.actionid > 0 or tileitem.uniqueid > 0) then
     doRemoveItem(moveitem.uid)
     doSendMagicEffect(position, CONST_ME_POFF)
   end
   return true
end
 

Attachments

Last edited by a moderator:
Back
Top