Player/IsDrivingEntity

From Garry's Mod
Jump to: navigation, search
 Player:IsDrivingEntity( )

Contents

Description

Used to find out if a player is currently 'driving' an entity (by which we mean 'right click > drive' ).

Returns

boolean

A value representing whether or not the player is 'driving' an entity.

Examples

Example

Kills every player currently 'driving' an entity.

local plys = player.GetAll()
for _, ply in pairs( plys ) do
    
    if ( ply:IsDrivingEntity() ) then
        ply:Kill()
    end
    
end

Output:

Every player 'driving' an entity will die a painful death.
Personal tools
Navigation