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

Teleport to temple

LUA:
function onLogout(cid)
     if isPlayer(cid) then
          db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
          setPlayerStorageValue(cid, 6776, -1)
     end
     return true
end
 
LUA:
local config, new = {
	minTownId = 1,
	maxTownId = 3
}, 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))
		doRemoveConditions(pid)
		doCreatureAddHealth(pid, getCreatureMaxHealth(pid))
		doCreatureAddMana(pid, getCreatureMaxMana(pid))
    		doBroadcastMessage("Map has been changed! Next map change will be in 25 minutes!", MESSAGE_STATUS_WARNING)
	end
	db.executeQuery("UPDATE players SET town_id = ".. new ..", posx = 0, posy = 0, posz = 0;")
	return true
end
 
Back
Top