best thing to do is to store your images paths in a table and use a current index variable for example
local currentImageIndex = 1
local myImages = {
"path1.png",
"path2.png"
}
and use dxDrawImage with the player Screen Width/Height ( guiGetScreenSize() ) to get the image on full screen, set your image to myImages[currentImageIndex] to set the image path with the current index in the table
local screenW, screenH = guiGetScreenSize()
function draw()
dxDrawImage(0, 0, screenW, screenH, myImages[currentImageIndex])
end
addEventHandler("onClientRender", getRootElement(), draw)
in order for your image to change after a specific time use a timer to update the current index as following:
local changeDuration = 2000 -- this will set my image to change every 2s
function updateCurrentImageIndex()
if ( currentImageIndex == #myImages) then return currentImageIndex = 1 end -- this is set to avoid having the index higher than the table count
currentImageIndex = currentImageIndex + 1
end
local myTimer = setTimer( updateCurrentImageIndex, changeDuration, 0)
with this way your image will be changing every 2s and make sure to destroy the timer and remove the onClientRender event.
please note this is just the concept of how i'd personally do it, try to replicate it your way, you can also possibly set a fade effect to make it look better