Entity.IsVehicle

From GMod Wiki

(Redirected from Player.IsVehicle)
Jump to: navigation, search
Function
Syntax Entity:IsVehicle( )
Description:
Returns true if the entity is a vehicle.
Returns: Boolean
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.IsVehicle]Entity.IsVehicle [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionIsVehicle preforms a simple check on an entity, in this example it's an entity "ent".
Used onNewerShared.png
Code
 
if ent:IsVehicle() then
        print( "It's a vehicle!" )
else
        print( "It's not a vehicle!" )
end
OutputThis example would print "It's a vehicle!" to console when "ent" is a vehicle, otherwise it would print "It's not a vehicle!"


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox