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

When players logout, I want them to spawn in temple when they login. Help me please!

Celsish

New Member
Joined
Apr 6, 2009
Messages
74
Reaction score
0
I want players to spawn in temple everytime they login, If they logout in depot I want them to spawn in Temple when they login!

I have a war server and it change map every 30 minutes. So if Players are in edron and players logout in edron dp I want him to login in edron temple etc..

can someone help me plz?
 
yes, here you are:
local min, max = 1, 5

local function changeMap(new, temple)
for _, pid in ipairs(getPlayersOnline()) do
if getCreatureStorage(pid, 4000) ~= 1 then
doTeleportThing(pid, temple)
doPlayerSetTown(pid, new)
doRemoveCondition(pid, CONDITION_INFIGHT)
end
end
doBroadcastMessage('The map has been changed to ' .. getTownName(new) .. '.')
db.executeQuery('UPDATE players SET town_id='.. new.. ', posx=0, posy=0, posz=0 WHERE group_id=1')
end

function onThink(interval, lastExecution)
local s = math.max(min, getStorage(123))
local new = s < max and s + 1 or min
doSetStorage(123, new)
doBroadcastMessage('Changing map within 1 minute to ' .. getTownName(new) .. '.')
addEvent(changeMap, 60000, new, getTownTemplePosition(new))
return true
end
 
Back
Top