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

Battle tile - TFS 1.0~1.2

Luccaw

New Member
Joined
Apr 23, 2016
Messages
2
Reaction score
0
Hello everyone!

Battle tile;
When a player is in battle with a monster, he can not leave and will appears a message saying "You can't get out without kill this monster."

Thanks!
 
Code:
function onStepOut(creature, item, position, fromPosition)
     if not creature:isPlayer() then
         return true
     end
     for _, s in pairs(Game.getSpectators(creature:getPosition(), false, false, 7, 7, 5, 5)) do
         if s:isMonster() and not s:getMaster() then
             creature:sendTextMessage(MESSAGE_INFO_DESCR, "You can't get out without kill this monster.")
             creature:teleportTo(fromPosition, false)
             return true
         end
     end
     return true
end
 
Back
Top