Player.Flashlight

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:Flashlight( Boolean on )
Description:
Turn the players flash light on / off
Returns: nil
In Object: Player
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.Flashlight]Player.Flashlight [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Example

DescriptionCreates a console command to toggle the player's flashlight.
Used onNewerServer.png
Code
concommand.Add("flashlight", function(ply) // Creating the concommand flashlight and linking it to a function
	ply:Flashlight( !ply:FlashlightIsOn() ) // Toggle the player's flashlight
end)
OutputNone


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox