Gmod13 Server Adverts help

Is there a addon where you can put adverts to your server that will repeat after a certian amount of time?
For example: “Join our steam group!”

[lua]if SERVER then

local Messages = {
"Join our Steam Group!",
"Apply on our forums!",
"Report cheaters!"
}

local Delay = 180

local Colors = {
Color(255, 0, 0),
Color(0, 255, 0),
Color(0, 0, 255)
}

util.AddNetworkString("Adverts")

local function Display()
	net.Start("Adverts")
	net.WriteTable({table.Random(Colors), table.Random(Messages)})
	net.Broadcast()
end

timer.Create("hi", Delay, 0, function()
	Display()
end)

else

net.Receive("Adverts", function()
	local str = net.ReadTable()
	chat.AddText(unpack(str))
end)

end[/lua]

Drop into GAME/lua/autorun/

Should work. Edit the messages to whatever you want.

Did not work…

Not that I have tested the code, but did you put it in a shared file?

Yes

[editline]23rd February 2014[/editline]

Do i have to name the file anything specific?

I didnt test it, but I can’t see anything wrong with it.

What the errors?

Do you even know what timer.Simple does?

He doesn’t want it show show an advert just once.
That’s all your code does is show one message, and it should be incrementing through the message table, not randomly selecting from it.

You’re missing “{}” around the values here as well:
[lua]
net.WriteTable(table.Random(Colors), table.Random(Messages))
[/lua]

until now i thought timer.simple didnt stop

im dumb nvm

[editline]24th February 2014[/editline]

fixed it, 2 lazy to do go down the table.