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

Login in random temple

Mr Zool

New Member
Joined
Jul 5, 2012
Messages
216
Reaction score
2
While login i want to player login in one of 6 random tmeple :
if less then 20 players online working only 1 temple (town 1).
 
Last edited:
ok i fixed this.

local towns = {1,2,3,4,5,6,7,8}
doTeleportThing(cid,getTownTemplePosition(towns[math.random(#towns)]))

But need thing to login in town 1 till 21 players online.


Need also "Talkactions" script - Commands
!t1 - teleporting to town1
!t2 - teleporting to town2
....
!t6 - teleporting to town6
 
add a onlogin function
if getOnlinePlayers() < 20 then
doTeleportThing(cid, town 1)
else
doTeleportThing(cid,getTownTemplePosition(towns[math.random(#towns)])
end
 
Code:
    if #getOnlinePlayers() < 20 then
            doTeleportThing(cid, getTownTemplePosition(1))
    else
            doTeleportThing(cid, getTownTemplePosition(towns[math.random(#towns)]))
    end
 
Last edited:
[6/10/2013 20:46:35] [Error - LuaInterface::loadFile] data/creaturescripts/scripts/login.lua:187: ')' expected (to close '(' at line 186) near 'end'
[6/10/2013 20:46:35] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/login.lua)
[6/10/2013 20:46:35] data/creaturescripts/scripts/login.lua:187: ')' expected (to close '(' at line 186) near 'end'


doTeleportThing(cid, getTownTemplePosition(towns[math.random(#towns)])
end


kkk i fixed it ;d
You missed one )


/Close and thanks
 
Back
Top