How to edit round timer?

I have my gmod server with a server round timer. The timer:
When I want to change the name of the round timer and then change the codes associated with the timer, all I get are errors. Why, and how do I fix this? I need round 1’s timer name to be “Peace” and round 2 to be “Purge”.

All help appreciated!

Did you make the script?


Yes, I thought about using Acecool’s from another thread but everyone was like “learn to code”, so I did.
I thought “Hey i’m just testing right now so i’ll put the names as number”, but now when I change it to anything besides single-digit numbers, I get errors.

-SNIP- Don’t steal peoples code and call it yours -_-.

bump, I just want an answer.

[editline]31st August 2014[/editline]

bump again.



In the future, don’t claim to have created something when you didn’t.

ROUND_TIMER.Round is networked as a number, so I’ll assume it is 1, 2, 3 etc for how many rounds you have.

When you output the text clientside, simply map the number to text.


ROUND_TIMER.HUD = function()
		draw.SimpleTextOutlined("The "..ROUND_TIMER.Round.." Ends In: "..math.Round((ROUND_TIMER.Time_Began+ROUND_TIMER.RoundTime[ROUND_TIMER.Round])-CurTime()), "ROUND_TIMER_Display", ScrW()/2, 20, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black)
	hook.Add("HUDPaint", "Draw Round Timer display.", ROUND_TIMER.HUD)


local RoundNames = {
 	[ 1 ] = "Something";
 	[ 2 ] = "Something else";

 	// Continue the pattern

hook.Add("HUDPaint", "Draw Round Timer display.", function( )
 	draw.SimpleTextOutlined("The " .. RoundNames[ ROUND_TIMER.Round ] .. " Ends In: " .. math.Round( ( ROUND_TIMER.Time_Began + ROUND_TIMER.RoundTime[ ROUND_TIMER.Round ] ) - CurTime( ) ), "ROUND_TIMER_Display", ScrW( ) / 2, 20, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black );
end );

Output: The Something Ends In: <rounded_time>
and: The Something else Ends In: …