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

killed monster creates a tp

Middan

New Member
Joined
Dec 24, 2013
Messages
22
Reaction score
0
Hey

iw got this script thats supposed to make a tp to s specific place whene killed. But when it get killed theres no teleport and no errows.... cane someone lock at my scripts and tell me if im mission something?

code in creaturescript

Code:
    <event type="kill" name="CreateTeleport" script="createteleport.lua"/>


and the script...

Code:
local config = {
  ["text"] = {time = 60, toPos = {x = 671, y = 963, z = 7}, tpPos = {x = 671, y = 966, 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


am i missing something?
 
Which server do you use?
Also make sure you have registered it in login.lua.

["text"] should be the monster name, so is the monster named text?
 
Back
Top