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

MoveEvent Trainers -- by Xikini

Is this script useful to you?

  • Yes.

    Votes: 3 75.0%
  • No.

    Votes: 0 0.0%
  • Undecided.

    Votes: 0 0.0%
  • We already have too many of this kind of script floating around.

    Votes: 1 25.0%

  • Total voters
    4
  • Poll closed .

Xikini

I whore myself out for likes
Senator
Premium User
Joined
Nov 17, 2010
Messages
6,795
Solutions
581
Reaction score
5,359
Edit: Improved code here.
Going to release a Training Monk script that me and my friend created long ago.
In short it's very easy to set-up, you can have it in any direction, and you should have no errors.
Tested on 0.3.7 TFS.
Only known bug: if someone get's kicked from trainers due to anti-idle, trainers will stay 'alive'.
However if another player or the logged out player logs in again, and steps out of the tile they will de-spawn as normal.
Now, on to the quick video demonstration, installation and mapping process!
------------------

------------------
Mapping the Area
Yn6T6Og.png

Grey tile = Non-walkable object. Such as a wall.
Brown tile = itemID 452 (brown unpressed pressure plate.)
Green tile = actionID 45555
----------------
Monster data/monster/monsters.xml
Code:
<monster name="trainers" file="trainers.xml"/>
----------------
Simple Trainer data/monster/trainers.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Trainers" nameDescription="a trainer" race="undead" experience="0" speed="100" manacost="0">
   <health now="123456" max="123456"/>
   <look typeex="5787" corpse="5968"/>
   <targetchange interval="2000" chance="100"/>
   <strategy attack="100" defense="0"/>
   <flags>
     <flag summonable="0"/>
     <flag attackable="1"/>
     <flag hostile="1"/>
     <flag illusionable="0"/>
     <flag convinceable="0"/>
     <flag pushable="0"/>
     <flag canpushitems="0"/>
     <flag canpushcreatures="1"/>
     <flag targetdistance="1"/>
     <flag staticattack="90"/>
     <flag runonhealth="1"/>
     <flag hidename="0"/>
   </flags>
   <attacks>
   <attack name="melee" interval="2000" skill="1" attack="1"/>
   </attacks>
   <defenses armor="0" defense="0">
     <defense name="healing" interval="10000" chance="100" min="123000" max="123001">
       <attribute key="areaEffect" value="blueshimmer"/>
     </defense>
   </defenses>
   <loot>
     <item id="12649" countmax="1" chance="100000"/><!-- gold coin -->
   </loot>
</monster>
----------------
Movements.xml data/movements/movements.xml
Code:
<movevent event="StepIn" actionid="45555" script="xikinitrainers.lua" />
<movevent event="StepOut" actionid="45555" script="xikinitrainers.lua" />
----------------
Script data/movements/scripts/xikinitrainers.lua
Code:
-- Credits to Xikini & Bert McCutchen for Idea's and Script
--Name of monster that will be spawned
local monsterName = "Trainers"
--Item ID of tile to spawn monster on
local spawningTileID = 446

function onStepIn(cid, item, position, fromPosition)
   --Positions to spawn monsters
   local topLeftPos = {x = (position.x - 1), y = (position.y - 1), z = position.z}
   local topRightPos = {x = (position.x + 1), y = (position.y - 1), z = position.z}
   local bottomLeftPos = {x = (position.x - 1), y = (position.y + 1), z = position.z}
   local bottomRightPos = {x = (position.x + 1), y = (position.y + 1), z = position.z}

   --spawn the monsters on any position that has the designated spawning tile
   --spawning tiles will only be spawned on if it matches to the spawning locations

   --top left
   if getTileThingByPos(topLeftPos).itemid == spawningTileID then
     doSendMagicEffect(topLeftPos, CONST_ME_FIREATTACK)
     doCreateMonster(monsterName, topLeftPos)
   end

   --top right
   if getTileThingByPos(topRightPos).itemid == spawningTileID then
     doSendMagicEffect(topRightPos, CONST_ME_FIREATTACK)
     doCreateMonster(monsterName, topRightPos)
   end

   --bottom left
   if getTileThingByPos(bottomLeftPos).itemid == spawningTileID then
     doSendMagicEffect(bottomLeftPos, CONST_ME_FIREATTACK)
     doCreateMonster(monsterName, bottomLeftPos)
   end

   --bottom right
   if getTileThingByPos(bottomRightPos).itemid == spawningTileID then
     doSendMagicEffect(bottomRightPos, CONST_ME_FIREATTACK)
     doCreateMonster(monsterName, bottomRightPos)
   end

   return true
end
function onStepOut(cid, item, position, fromPosition)
   --Positions to despawn spawn monsters
   local topLeftFromPos = {x = (fromPosition.x - 1), y = (fromPosition.y - 1), z = fromPosition.z, stackpos = 253}
   local topRightFromPos = {x = (fromPosition.x + 1), y = (fromPosition.y - 1), z = fromPosition.z, stackpos = 253}
   local bottomLeftFromPos = {x = (fromPosition.x - 1), y = (fromPosition.y + 1), z = fromPosition.z, stackpos = 253}
   local bottomRightFromPos = {x = (fromPosition.x + 1), y = (fromPosition.y + 1), z = fromPosition.z, stackpos = 253}

   --delete any creature by the name of monsterName from specific positions

   --top left
   if isMonster(getThingFromPos(topLeftFromPos).uid) then
     if getCreatureName(getThingFromPos(topLeftFromPos).uid) == monsterName then
       doRemoveCreature(getThingFromPos(topLeftFromPos).uid)
       doSendMagicEffect(topLeftFromPos, CONST_ME_POFF)
     end
   end

   --top right
   if isMonster(getThingFromPos(topRightFromPos).uid) then
     if getCreatureName(getThingFromPos(topRightFromPos).uid) == monsterName then
       doRemoveCreature(getThingFromPos(topRightFromPos).uid)
       doSendMagicEffect(topRightFromPos, CONST_ME_POFF)
     end
   end

   --bottom left
   if isMonster(getThingFromPos(bottomLeftFromPos).uid) then
     if getCreatureName(getThingFromPos(bottomLeftFromPos).uid) == monsterName then
       doRemoveCreature(getThingFromPos(bottomLeftFromPos).uid)
       doSendMagicEffect(bottomLeftFromPos, CONST_ME_POFF)
     end
   end

   --bottom right
   if isMonster(getThingFromPos(bottomRightFromPos).uid) then
     if getCreatureName(getThingFromPos(bottomRightFromPos).uid) == monsterName then
       doRemoveCreature(getThingFromPos(bottomRightFromPos).uid)
       doSendMagicEffect(bottomRightFromPos, CONST_ME_POFF)
     end
   end

   return true
end
----------------
Some quick Q&A

Q: Why is my monster not spawning?

A: You either haven't set-up the map properly, or the target monster does not exist. Check monsters.xml

Q: Why is my monster not de-spawning?

A: You have most likely named the monster incorrectly. The filename of the monster does not matter. Only the actual name of the monster.

Q: The monsters are spawning oddly!

A: Ensure you follow the picture and set-up your map the same way. Direction doesn't matter.

Q: Can I use different tiles under the trainers?

A: If you can adjust the script properly then yes. Otherwise just use what is stated.

Q: Does the green tile have to have a specific itemID?

A: No. As long as the tile has the correct actionID the monsters will spawn fine.

Q: Can I use any non-walkable tile for the grey tiles?

A: Yes. Any wall, bush, tree, mountain side, pole.. any object should work. Untested with water, lava, tables, et cetera. However, if your having troubles just test with a couple different objects.

Hopefully this covers most everything!
Give a like if you wish, and post some screenshots of your creative training grounds below!

Credit where credit is due.
Xikini, myself, for the idea and the initial script.
Transcending, my friend, for the final script shown here.

Cheers,
Xikini
 
Last edited:
To fix the bug just set a storage value in onstepin function to 1 and onstepout to 0 :)

I haven't tested this, but this should help fix the bug in your script, I didn't want to change it too much :p

Code:
-- Credits to Xikini & Bert McCutchen for Idea's and Script
--Name of monster that will be spawned
local monsterName = "Trainers"
--Item ID of tile to spawn monster on
local spawningTileID = 446

function onStepIn(cid, item, position, fromPosition)
    if isPlayer(cid) then -- have to make sure it is a player and not a summons or monster
        setPlayerStorageValue(cid, 19000, 1) -- 19000 can be any number not already in use
      --Positions to spawn monsters
      local topLeftPos = {x = (position.x - 1), y = (position.y - 1), z = position.z}
      local topRightPos = {x = (position.x + 1), y = (position.y - 1), z = position.z}
      local bottomLeftPos = {x = (position.x - 1), y = (position.y + 1), z = position.z}
      local bottomRightPos = {x = (position.x + 1), y = (position.y + 1), z = position.z}

      --spawn the monsters on any position that has the designated spawning tile
      --spawning tiles will only be spawned on if it matches to the spawning locations

      --top left -- we also want to make sure the player has been flag to summon the creature
      if getTileThingByPos(topLeftPos).itemid == spawningTileID and (getPlayerStorageValue(cid, 19000) == 1) then
        doSendMagicEffect(topLeftPos, CONST_ME_FIREATTACK)
        doCreateMonster(monsterName, topLeftPos)
      end

      --top right
      if getTileThingByPos(topRightPos).itemid == spawningTileID and (getPlayerStorageValue(cid, 19000) == 1) then
        doSendMagicEffect(topRightPos, CONST_ME_FIREATTACK)
        doCreateMonster(monsterName, topRightPos)
      end

      --bottom left
      if getTileThingByPos(bottomLeftPos).itemid == spawningTileID and (getPlayerStorageValue(cid, 19000) == 1) then
        doSendMagicEffect(bottomLeftPos, CONST_ME_FIREATTACK)
        doCreateMonster(monsterName, bottomLeftPos)
      end

      --bottom right
      if getTileThingByPos(bottomRightPos).itemid == spawningTileID and (getPlayerStorageValue(cid, 19000) == 1) then
        doSendMagicEffect(bottomRightPos, CONST_ME_FIREATTACK)
        doCreateMonster(monsterName, bottomRightPos)
      end
    end
   return true
end
function onStepOut(cid, item, position, fromPosition)
   
   --Positions to despawn spawn monsters
   local topLeftFromPos = {x = (fromPosition.x - 1), y = (fromPosition.y - 1), z = fromPosition.z, stackpos = 253}
   local topRightFromPos = {x = (fromPosition.x + 1), y = (fromPosition.y - 1), z = fromPosition.z, stackpos = 253}
   local bottomLeftFromPos = {x = (fromPosition.x - 1), y = (fromPosition.y + 1), z = fromPosition.z, stackpos = 253}
   local bottomRightFromPos = {x = (fromPosition.x + 1), y = (fromPosition.y + 1), z = fromPosition.z, stackpos = 253}

   --delete any creature by the name of monsterName from specific positions

   --top left -- when they step off the tile or log out, this checks if the player had the storage value set and removes the creature
   if isMonster(getThingFromPos(topLeftFromPos).uid) and (getPlayerStorageValue(cid, 19000) == 1) then
     if getCreatureName(getThingFromPos(topLeftFromPos).uid) == monsterName then
       doRemoveCreature(getThingFromPos(topLeftFromPos).uid)
       doSendMagicEffect(topLeftFromPos, CONST_ME_POFF)
     end
   end

   --top right
   if isMonster(getThingFromPos(topRightFromPos).uid) and (getPlayerStorageValue(cid, 19000) == 1) then
     if getCreatureName(getThingFromPos(topRightFromPos).uid) == monsterName then
       doRemoveCreature(getThingFromPos(topRightFromPos).uid)
       doSendMagicEffect(topRightFromPos, CONST_ME_POFF)
     end
   end

   --bottom left
   if isMonster(getThingFromPos(bottomLeftFromPos).uid) and (getPlayerStorageValue(cid, 19000) == 1) then
     if getCreatureName(getThingFromPos(bottomLeftFromPos).uid) == monsterName then
       doRemoveCreature(getThingFromPos(bottomLeftFromPos).uid)
       doSendMagicEffect(bottomLeftFromPos, CONST_ME_POFF)
     end
   end

   --bottom right
   if isMonster(getThingFromPos(bottomRightFromPos).uid) and (getPlayerStorageValue(cid, 19000) == 1) then
     if getCreatureName(getThingFromPos(bottomRightFromPos).uid) == monsterName then
       doRemoveCreature(getThingFromPos(bottomRightFromPos).uid)
       doSendMagicEffect(bottomRightFromPos, CONST_ME_POFF)
     end
   end
   setPlayerStorageValue(cid, 19000, 0) -- finally the storage value is reset to 0
   return true
end
 
Last edited:
To fix the bug just set a storage value in onstepin function to 1 and onstepout to 0 :)

I haven't tested this, but this should help fix the bug in your script, I didn't want to change it too much :p

Code:
-- Credits to Xikini & Bert McCutchen for Idea's and Script
--Name of monster that will be spawned
local monsterName = "Trainers"
--Item ID of tile to spawn monster on
local spawningTileID = 446

function onStepIn(cid, item, position, fromPosition)
    if isPlayer(cid) then -- have to make sure it is a player and not a summons or monster
        setPlayerStorageValue(cid, 19000, 1) -- 19000 can be any number not already in use
      --Positions to spawn monsters
      local topLeftPos = {x = (position.x - 1), y = (position.y - 1), z = position.z}
      local topRightPos = {x = (position.x + 1), y = (position.y - 1), z = position.z}
      local bottomLeftPos = {x = (position.x - 1), y = (position.y + 1), z = position.z}
      local bottomRightPos = {x = (position.x + 1), y = (position.y + 1), z = position.z}

      --spawn the monsters on any position that has the designated spawning tile
      --spawning tiles will only be spawned on if it matches to the spawning locations

      --top left -- we also want to make sure the player has been flag to summon the creature
      if getTileThingByPos(topLeftPos).itemid == spawningTileID and (getPlayerStorageValue(cid, 19000) == 1) then
        doSendMagicEffect(topLeftPos, CONST_ME_FIREATTACK)
        doCreateMonster(monsterName, topLeftPos)
      end

      --top right
      if getTileThingByPos(topRightPos).itemid == spawningTileID and (getPlayerStorageValue(cid, 19000) == 1) then
        doSendMagicEffect(topRightPos, CONST_ME_FIREATTACK)
        doCreateMonster(monsterName, topRightPos)
      end

      --bottom left
      if getTileThingByPos(bottomLeftPos).itemid == spawningTileID and (getPlayerStorageValue(cid, 19000) == 1) then
        doSendMagicEffect(bottomLeftPos, CONST_ME_FIREATTACK)
        doCreateMonster(monsterName, bottomLeftPos)
      end

      --bottom right
      if getTileThingByPos(bottomRightPos).itemid == spawningTileID and (getPlayerStorageValue(cid, 19000) == 1) then
        doSendMagicEffect(bottomRightPos, CONST_ME_FIREATTACK)
        doCreateMonster(monsterName, bottomRightPos)
      end
    end
   return true
end
function onStepOut(cid, item, position, fromPosition)
  
   --Positions to despawn spawn monsters
   local topLeftFromPos = {x = (fromPosition.x - 1), y = (fromPosition.y - 1), z = fromPosition.z, stackpos = 253}
   local topRightFromPos = {x = (fromPosition.x + 1), y = (fromPosition.y - 1), z = fromPosition.z, stackpos = 253}
   local bottomLeftFromPos = {x = (fromPosition.x - 1), y = (fromPosition.y + 1), z = fromPosition.z, stackpos = 253}
   local bottomRightFromPos = {x = (fromPosition.x + 1), y = (fromPosition.y + 1), z = fromPosition.z, stackpos = 253}

   --delete any creature by the name of monsterName from specific positions

   --top left -- when they step off the tile or log out, this checks if the player had the storage value set and removes the creature
   if isMonster(getThingFromPos(topLeftFromPos).uid) and (getPlayerStorageValue(cid, 19000) == 1) then
     if getCreatureName(getThingFromPos(topLeftFromPos).uid) == monsterName then
       doRemoveCreature(getThingFromPos(topLeftFromPos).uid)
       doSendMagicEffect(topLeftFromPos, CONST_ME_POFF)
     end
   end

   --top right
   if isMonster(getThingFromPos(topRightFromPos).uid) and (getPlayerStorageValue(cid, 19000) == 1) then
     if getCreatureName(getThingFromPos(topRightFromPos).uid) == monsterName then
       doRemoveCreature(getThingFromPos(topRightFromPos).uid)
       doSendMagicEffect(topRightFromPos, CONST_ME_POFF)
     end
   end

   --bottom left
   if isMonster(getThingFromPos(bottomLeftFromPos).uid) and (getPlayerStorageValue(cid, 19000) == 1) then
     if getCreatureName(getThingFromPos(bottomLeftFromPos).uid) == monsterName then
       doRemoveCreature(getThingFromPos(bottomLeftFromPos).uid)
       doSendMagicEffect(bottomLeftFromPos, CONST_ME_POFF)
     end
   end

   --bottom right
   if isMonster(getThingFromPos(bottomRightFromPos).uid) and (getPlayerStorageValue(cid, 19000) == 1) then
     if getCreatureName(getThingFromPos(bottomRightFromPos).uid) == monsterName then
       doRemoveCreature(getThingFromPos(bottomRightFromPos).uid)
       doSendMagicEffect(bottomRightFromPos, CONST_ME_POFF)
     end
   end
   setPlayerStorageValue(cid, 19000, 0) -- finally the storage value is reset to 0
   return true
end
We thought of this before, (and just to be sure I tested the edited script) but the problem lies in that it's not a movevent when they get kicked, the player simply disappears, and there's no 'action' telling any script to despawn the creatures.
I believe it would need a onlogin/onlogout script to work perfectly, however after a couple tests we were unsuccessful.
If someone knows how to incorporate it into the script, or a logout/login function, I'd definitely add it to the first post. :p
 
Wasn't always like that, the onstep functions use to work flawlessly i don't know why they changed it, I haven't really looked into this further if there is a onLogOut function.

But you can place inside of login.lua, inside of onLogin(cid), this way when they login it will reset the storage value or just set it, because I've noticed a script will not activate if it is looking for a non-existing storage value

Code:
function onLogin(cid)
    setPlayerStorageValue(cid, 19000, 0)
end

That would also mean the current comparison in onStepOut (the one i added) would be useless since you would have to set the storage value to 0 and then run a comparison of getPlayerStorageValue(cid, 1900) == 0

Not everything you code always works the 1st time you write it, so don't worry about whether your a good or bad coder, remember your writing code under a framework which is not exactly perfect itself. :)

I also want to point out we don't have enough of these kinds of scripts floating around, we need more of these kinds of scripts and of other kinds as well, there is no 1 definitive way to accomplish a specific task. You can learn a lot from other people's code so keep on coding and reinventing the wheel, besides who is to say that the wheel is perfect! :)
 
Last edited:
Its a pretty cool feature I guess and thanks for sharing! I dont really see this usefull though! =)
 
Bumping for those who may be interested.
Would be interesting to see some peoples mapping of the area.
Using mountain walls on a beach?
Standard monk rooms?
Centered around a fiery column of fire?
Just some idea's :p
 
I would re-write it to make it smaller... but for tfs 1.x because I could test it, idk i've been writing people scripts for 8.6 - 9.6 servers and its like a hit or miss 50 / 50 chance the scripts work.

Let me rephrase this in a tfs 1.x format.
 
Very fun script, thanks for sharing @Xikini

A shorter version, anyone is welcome to shorten it further if they like:
Code:
function onStepIn(cid, item, position, fromPosition)

local config = {
    monsterName = "Rat", -- Name of Monster
    spawningTileID = 426, -- Tile ID where monster should spawn
    effectSummon = CONST_ME_FIREATTACK, -- effect that should appear when monster spawns
    positions = {
        [1] = {x = (position.x - 1), y = (position.y - 1), z = position.z},
        [2] = {x = (position.x + 1), y = (position.y - 1), z = position.z},
        [3] = {x = (position.x - 1), y = (position.y + 1), z = position.z},
        [4] = {x = (position.x + 1), y = (position.y + 1), z = position.z}
    }
}

    if not isPlayer(cid) then
        return true
    end
    for i=1, #config.positions do
        if getTileThingByPos(config.positions[i]).itemid == config.spawningTileID then
         doSendMagicEffect(config.positions[i], config.effectSummon)
         doCreateMonster(config.monsterName, config.positions[i])
        end
    end

return true
end

function onStepOut(cid, item, position, fromPosition)

local config = {
    monsterName = "Rat", -- Name of Monster
    effectRemove = CONST_ME_POFF, -- effect that should appear when monster is removed
    positions = {
        [1] = {x = (fromPosition.x - 1), y = (fromPosition.y - 1), z = fromPosition.z, stackpos = 253},
        [2] = {x = (fromPosition.x + 1), y = (fromPosition.y - 1), z = fromPosition.z, stackpos = 253},
        [3] = {x = (fromPosition.x - 1), y = (fromPosition.y + 1), z = fromPosition.z, stackpos = 253},
        [4] = {x = (fromPosition.x + 1), y = (fromPosition.y + 1), z = fromPosition.z, stackpos = 253}
    }
}

    if not isPlayer(cid) then
        return true
    end
   
    for i=1, #config.positions do
        if isMonster(getThingFromPos(config.positions[i]).uid) then
            if getCreatureName(getThingFromPos(config.positions[i]).uid) == config.monsterName then
               doRemoveCreature(getThingFromPos(config.positions[i]).uid)
               doSendMagicEffect(config.positions[i], config.effectRemove)
            end
        end
    end
   
return true
end

Logout function:
Code:
<event type="logout" name="trainer_logout" event="script" value="test_trainer.lua"/>
Code:
function onLogout(cid)
local fromPosition = getPlayerPosition(cid)
local config = {
    monsterName = "Rat", -- Name of Monsters
    effectRemove = CONST_ME_POFF,
    positions = {
        [1] = {x = (fromPosition.x - 1), y = (fromPosition.y - 1), z = fromPosition.z, stackpos = 253},
        [2] = {x = (fromPosition.x + 1), y = (fromPosition.y - 1), z = fromPosition.z, stackpos = 253},
        [3] = {x = (fromPosition.x - 1), y = (fromPosition.y + 1), z = fromPosition.z, stackpos = 253},
        [4] = {x = (fromPosition.x + 1), y = (fromPosition.y + 1), z = fromPosition.z, stackpos = 253}
    }
}

    for i=1, #config.positions do
        if isMonster(getThingFromPos(config.positions[i]).uid) then
            if getCreatureName(getThingFromPos(config.positions[i]).uid) == config.monsterName then
               doRemoveCreature(getThingFromPos(config.positions[i]).uid)
               doSendMagicEffect(config.positions[i], config.effectRemove)
            end
        end
    end
return true
end
 
Bumping for reasons.
I hope more people enjoy the script.
 
Improvements to the code.
Code:
-- Credits to Xikini & Bert McCutchen for Idea's and Script
--Name of monster that will be spawned
local monsterName = "Trainers"
--Item ID of tile to spawn monster on
local spawningTileID = 446
function addTrainer(pos)
  if getTileThingByPos(pos).itemid == spawningTileID then
  doSendMagicEffect(pos, CONST_ME_FIREATTACK)
  doCreateMonster(monsterName, pos)
  end
end
function removeTrainer(pos)
  local thing = getThingFromPos(pos)
  if isMonster(thing.uid) and getCreatureName(thing.uid) == monsterName then
  doRemoveCreature(thing.uid)
  doSendMagicEffect(pos, CONST_ME_POFF)
  end
end
function onStepIn(cid, item, position, fromPosition)
  --Positions to spawn monsters
  local topLeftPos = {x = (position.x - 1), y = (position.y - 1), z = position.z}
  local topRightPos = {x = (position.x + 1), y = (position.y - 1), z = position.z}
  local bottomLeftPos = {x = (position.x - 1), y = (position.y + 1), z = position.z}
  local bottomRightPos = {x = (position.x + 1), y = (position.y + 1), z = position.z}
  --spawn the monsters on any position that has the designated spawning tile
  --spawning tiles will only be spawned on if it matches to the spawning locations
  addTrainer(topLeftPos)
  addTrainer(topRightPos)
  addTrainer(bottomLeftPos)
  addTrainer(bottomRightPos)
  return true
end
function onStepOut(cid, item, position, fromPosition)
  --Positions to despawn spawn monsters
  local topLeftFromPos = {x = (fromPosition.x - 1), y = (fromPosition.y - 1), z = fromPosition.z, stackpos = 253}
  local topRightFromPos = {x = (fromPosition.x + 1), y = (fromPosition.y - 1), z = fromPosition.z, stackpos = 253}
  local bottomLeftFromPos = {x = (fromPosition.x - 1), y = (fromPosition.y + 1), z = fromPosition.z, stackpos = 253}
  local bottomRightFromPos = {x = (fromPosition.x + 1), y = (fromPosition.y + 1), z = fromPosition.z, stackpos = 253}
  --delete any creature by the name of monsterName from specific positions
  removeTrainer(topLeftFromPos)
  removeTrainer(topRightFromPos)
  removeTrainer(bottomLeftFromPos)
  removeTrainer(bottomRightFromPos)
  return true
end
You can also add this part to the step in/out functions if you only want players to activate the tiles. (Useful if monsters/summons can reach the tile)
Code:
if(not isPlayer(cid)) then
     return true
end
 
Last edited:
One last bump, just because.
 
Back
Top