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

Lua Change Map, Skull System Error

Ghazer

Member
Joined
Mar 13, 2009
Messages
350
Reaction score
6
is there anyone who can help me?, i need to take out the function of removing the protecion zone lock in the map changing because its geting buged with the skull system mod i would like to kick all the players on the map changings instead of removing the pz lock


changemap:
Code:
local config, new = {
   minTownId = 1,
   maxTownId = 6
}, 0
function onThink(interval, lastExecution)
   for _, pid in ipairs(getPlayersOnline()) do
      local town = getPlayerTown(pid)
      new = town < config.maxTownId and town + 1 or config.minTownId
      doPlayerSetTown(pid, new)
      doTeleportThing(pid, getTownTemplePosition(new))
      doCreatureAddHealth(pid, getCreatureMaxHealth(pid))
      doCreatureAddMana(pid, getCreatureMaxMana(pid))
          doBroadcastMessage("Map has been changed! Next map change will be in 30 minutes!", MESSAGE_STATUS_WARNING)
   end
   db.executeQuery("UPDATE players SET town_id = ".. new ..", posx = 0, posy = 0, posz = 0;")
   return true
end
 
Last edited:
remove this line:
Code:
doRemoveCondition(pid, CONDITION_INFIGHT)
and replace it with this one:

Code:
doRemoveCreature(cid)
 
doesn't work has any other ideas?

- - - Updated - - -

remove this line:
Code:
doRemoveCondition(pid, CONDITION_INFIGHT)
and replace it with this one:

Code:
doRemoveCreature(cid)

Thank you, I only change your cid for pid
 
Last edited:
Back
Top