• 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 remove wall

imback1

Unknown member
Joined
Jul 11, 2013
Messages
785
Solutions
1
Reaction score
46
hello otlanders
i need script when kill a monster X remove wall at position X and create same wall after X time btw i didn't see this before i just wondering if someone help me
thx
 
you could edit the create teleport script to remove a wall instead of creating a teleport
i tried it but bugged server when i killed the monster
Code:
local config = {
   ["demon"] = {time = 60, wallPos = {x = 992, y = 994, z = 7}},
}
local function deleteWall(tp)
  local wall = getTileItemById(tp, 1107).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
  doRemoveWall(1107, monster.toPos, monster.tpPos)
  doCreatureSay(cid, "You have "..monster.time.." seconds to enter the teleport!", TALKTYPE_ORANGE_1)
  addEvent(deleteWall, monster.time * 1000, monster.tpPos)
  return true
end
 
Use the Request board for script requests.
If you have a script, but it's not working, then you can use Support.

Moving this for now.
 
"not working"

Why doesn't it work? Because the sky is blue? Because my dog ate poop?
I wonder why it doesn't work... did the error mention anything about doRemoveWall() being a nil value? Hmm, I wonder...

You need to start posting errors if there are any!
 
Please don't edit your entire posts with "Solved" as someone else may have a similar issue to search for.
 
Original Code
Code:
local config = {
   ["demon"] = {time = 60, wallPos = {x = 992, y = 994, z = 7}},
}
local function deleteWall(tp)
  local wall = getTileItemById(tp, 1107).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
  doRemoveWall(1107, monster.toPos, monster.tpPos)
  doCreatureSay(cid, "You have "..monster.time.." seconds to enter the teleport!", TALKTYPE_ORANGE_1)
  addEvent(deleteWall, monster.time * 1000, monster.tpPos)
  return true
end
because you are funny man o_O
Sure we know what the issue is just by looking at the code, but you need to provide the error regardless, you can't just tell us your script doesn't work and leave it at that.

By providing as much information as possible increases your chances of getting help by 10 fold.

The table config, its element demon does not have properties called toPos or tpPos, teleport is not defined in deleteWall, doRemoveWall is not a tfs function and is not defined in the script. passing a nil value to deleteWall will also return an error.

You can't just copy and paste code into a script from other scripts and expect it to work without knowing what that code does. You should focus more on learning to write a script than editing it.
 
Original Code


Sure we know what the issue is just by looking at the code, but you need to provide the error regardless, you can't just tell us your script doesn't work and leave it at that.

By providing as much information as possible increases your chances of getting help by 10 fold.

The table config, its element demon does not have properties called toPos or tpPos, teleport is not defined in deleteWall, doRemoveWall is not a tfs function and is not defined in the script. passing a nil value to deleteWall will also return an error.

You can't just copy and paste code into a script from other scripts and expect it to work without knowing what that code does. You should focus more on learning to write a script than editing it.
i copied script from another and made some changes and its working good now ,CLOSED
 
Back
Top