Temporary text with auto changing

Hi, i was wondering how to make temporary text on screen that will change text after some time?
I want to make some text appearing at screen that will be displayed every 50 second but with random text.
I was thinking to make random table to make it work but i don’t know hot to exactly make entire script to work.

I used this to display text on screen


hook.Add( "HUDPaint", "drawtext", function()
	surface.SetFont( "MyFont" )
	surface.SetTextColor( 255, 255, 255, 255 )
	surface.SetTextPos( 1500, 75 )
	surface.DrawText( "hint" )
end )

You can just use

draw.DrawText: [lua]local hints = { – table of options
“Random text 1”,
“Random text 2”
}

local current = math.random(#hints) – index of currently displayed text from the table

local function newRandom() – function to change current text to some other random entry
local old = current – prevent same items from being chosen twice in a row
while current == old do
current = math.random(#hints)
end
end

timer.Create(“My Hints”, 50, 0, newRandom)

local function drawText() – function to actually draw our text
draw.DrawText(hints[current])
end

hook.Add(“HUDPaint”, “My Hints”, drawText)[/lua]This is a very basic example, but it should give you the general idea of how it’s done.

Thanks,you really helped me.
But is it possible to make text displaying on screen for 10 seconds and after it will disappear and then after some time will appear new text?

Yes, this should help you.

CurTime