Jump to content

Tables Help


FlyingSpoon

Recommended Posts

local texts = {
 {"Text 1"},
 {"Text 2"},
 {"Text 3"},
 {"Text 4"},
 {"Text 5"},

}

dxDrawText("", screenW * 0.3555, screenH * 0.7014, screenW * 0.6414, screenH * 0.8403, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)

How would I set a timer for 8 seconds, to go through all the texts in the 'texts table' ?

Edited by raysmta
Link to comment
  • Moderators
local texts = {
 "Text 1",
 "Text 2",
 "Text 3",
 "Text 4",
 "Text 5"
}


local textIndex = 1

setTimer(function ()
  textIndex = textIndex+1
end, 8000, #texts)

-----

dxDrawText(texts[textIndex], screenW * 0.3555, screenH * 0.7014, screenW * 0.6414, screenH * 0.8403, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) 

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...