SWEP.Think

From GMod Wiki

Revision as of 17:58, 8 May 2011 by nathanbarnard (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NameThink
SyntaxSWEP:Think( )
DescriptionThis function is run every tick.
ReturnsNil
Lua StateNewerShared.png
BBCode[b][url=wiki.garrysmod.com/?title=SWEP.Think]SWEP.Think [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]

Examples

DescriptionCreate a global TestValue, then raise it by 1 every time Think() runs
Used onNewerClient.png
Code
TestValue = 0
function SWEP:Think()
	TestValue = TestValue + 1
end
OutputIf TestValue is not modified by any other function, it will continue to increase rapidly until the player switches to another weapon


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox