trying to make tips

I’m trying to get this to show a tip in the chat box but it only shows the same one every 60 seconds. I want it to show different ones every time. here’s what I got so far:

[lua]tips = {
“press F4 to see the player menu”,
“please respect the admins”,
“you’re playing Carb’s Build”,
“want something? ask an admin”,
“type /money or !money to check your pockets for any cash”,
“you an admin? need some cash? type /makemoney to get some more money”
}

local cbtips = table.Random( tips )

function tips()
timer.Create(“Tips”, 60, 0, function()
for k,v in pairs(player.GetAll()) do
v:ChatPrint(cbtips)
end
end)
end
hook.Add( “Initialize”, “cbtips”, tips )[/lua]

nvm, i dunno

now it doesn’t display the tips

[lua]local cbtips = table.Random( tips ) [/lua]

This will chose a random entry **once **and store it in cbtips. That is not what you want.

Try this:

[lua]
function tips()
timer.Create(“Tips”, 60, 0, function()
for k,v in pairs(player.GetAll()) do
local cbtips = table.Random( tips )
v:ChatPrint(cbtips)
end
end)
end
[/lua]

This will pick a random entry every time the timer is run.

thanks, I knew it would only run once but I didn’t know how to make it run every time it was used.