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

random backgroun in login panel

return

New Member
Joined
Jan 14, 2013
Messages
10
Reaction score
0
hello, i search how i can add more background and use random background every time you run clinet
 
client_background/background.lua

Code:
function init()
   background = g_ui.displayUI('background')
   local rand = math.random(5) --5 is the number of imgs which you have put in the folder!
   background:setImageSource('/images/backgrounds/background'..rand)
   ...
end

data/images/
create a folder with name backgrounds and put the images inside, with name: 'background1', 'background2', 'background3'...

or you can create a table in the .lua with the name of all imgs and use math.random in this table... ;p
 
Back
Top