Garry's Mod Wiki

Player:SetFlashlightColor

  Player:SetFlashlightColor( Color color = Color(255,255,255) )

Description

Sets the color of a player's flashlight. Can be used on other players.

Arguments

1 Color color = Color(255,255,255)
Flashlight color

Example

Makes local player's flashlight cycle through all the rainbow colors

hook.Add( "Think", "RainbowFlashlight", function() local clr = HSVToColor( ( CurTime() * 20 ) % 360, 1, 1 ); LocalPlayer():SetFlashlightColor( clr ) end )