Flasing Names for Admins on the Scoreboard

Hello, I want my admins’ names to flash on the scoreboard just like this:

https://www.youtube.com/watch?v=p0i6U-WbSz0&feature=youtu.be (WATCH IN 1080P)

How would I do this?

To do that, you have two different draw.SimpleText or whatever you use for drawing the text…

The first one is the one you change to glow. It should be larger than the primary non-flashing text.

Just make the color this:

[lua]Color( 255, 0, 0, math.abs( math.sin( CurTime( ) * _speed ) * 255 ) );[/lua]

replace _speed with how fast you want it to flash; it can be a decimal number or large number.

Example:
[lua]local offset = 2; // How many pixels offset should the word be? This is half the size of how much bigger the bigger font is
draw.SimpleText( “Clock”, “defaultBIGGER”, 50 - offset, 50 - offset, Color( 255, 0, 0, math.abs( math.sin( CurTime( ) * 180 ) * 255 ) ) )
draw.SimpleText( “Clock”, “default”, 50, 50, Color( 0, 0, 0, 255 ) )[/lua]

Instead of flashing just the alpha which makes the color become transparent and back to full, you can use the same function for each individual color element instead. So Color( x, 0, 0, 255 ) will scale red from RED to black and back up.

EDIT: Hey, this thread is right on the front page… http://forum.facepunch.com/showthread.php?t=1159241

Lol, that’s from 2007.

I’m having trouble finding where to put this with the fadmin scoreboard…

I have no idea why you bumped it then… But the code is still relevant, I gave an example of what it should look like and what offset it should be at. Try it out.

It should be put where the players name is drawn on the scoreboard. You’ll see something like ply or Player or whatever:Nick( )

Also, for DarkRP questions:

General Learning Lua Help Thread: http://forum.facepunch.com/showthread.php?t=1337945

Problems that don’t need their own thread ( All simple questions / quickies should go here ): http://forum.facepunch.com/showthread.php?t=1348923

DarkRP Help Thread ( ALL DarkRP Questions go here ): http://forum.facepunch.com/showthread.php?t=1249475

Looking to HIRE a coder? Read this: http://forum.facepunch.com/showthread.php?t=1257110

Coderhire Thread: http://forum.facepunch.com/showthread.php?t=1281665



local ColorFreq = 0.5

function TheyCallMeFlashy()
	local r = math.sin( ColorFreq * RealTime() ) * 127 + 128
	local g = math.sin( ColorFreq * RealTime() + 2 ) * 127 + 128
	local b = math.sin( ColorFreq * RealTime() + 4 ) * 127 + 128
	return Color( r, g, b )
end


Edit:
Realized that he wanted it one color.
Oh well.

[lua]Color(TimedSin(1, 0, 255, 0), 0, 0)[/lua]

I can’t test it bc I’m at work but have you all forgotten TimedSin/Cos? :slight_smile: https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/includes/util.lua#L302