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

OTClient multi picture client

otuserbyme

New Member
Joined
Nov 10, 2011
Messages
54
Reaction score
1
how can I add a way to make my otclient have more than 1 picture?
I have 10 pictures for the client but I would like to use them all randomly so a new pic comes up each time a client is launched
thanks for any help
 
modules/client_background/background.lua

change init function to this:
PHP:
function init()
  background = g_ui.displayUI('background')
  background:lower()

  math.randomseed(os.time())
  -- images named background-1, background-2, ..., background-10...
  background:setImageSource('/images/background-' .. math.random(10) .. '.png')


  clientVersionLabel = background:getChildById('clientVersionLabel')
  clientVersionLabel:setText(g_app.getName() .. ' ' .. g_app.getVersion() .. '\n' ..
                             'Rev  ' .. g_app.getBuildRevision() .. ' ('.. g_app.getBuildCommit() .. ')\n' ..
                             'Built on ' .. g_app.getBuildDate())

  if not g_game.isOnline() then
    addEvent(function() g_effects.fadeIn(clientVersionLabel, 1500) end)
  end

  connect(g_game, { onGameStart = hide })
  connect(g_game, { onGameEnd = show })
end
 
Back
Top