Entity.IsPlayerHolding

From GMod Wiki

Revision as of 16:34, 6 January 2011 by Cube334 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax Entity:IsPlayerHolding( )
Description:
Returns true if the entity is being held by a player.
Returns: Boolean
In Object: Entity
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.IsPlayerHolding]Entity.IsPlayerHolding [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionIn a SENT think function, makes the SENT green if held and red otherwise.
Used onNewerServer.png
Code
function SENT:Think()
	if self:IsPlayerHolding() then
		self:SetColor(0,255,0,255)
	else
		self:SetColor(255,0,0,255)
	end
end
OutputGreen or red color.


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox