Garry's Mod Wiki

Revision Difference

Player:IsDrivingEntity#512683

<function name="IsDrivingEntity" parent="Player" type="classfunc">⤶ <description>Used to find out if a player is currently 'driving' an entity (by which we mean 'right click &amp;gt; drive' ).</description>⤶ <realm>Shared</realm>⤶ <rets>⤶ <ret name="" type="boolean">A value representing whether or not the player is 'driving' an entity.</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>Kills every player currently 'driving' an entity.</description>⤶ <code>⤶ local plys = player.GetAll()⤶ for _, ply in pairs( plys ) do⤶ ⤶ if ( ply:IsDrivingEntity() ) then⤶ ply:Kill()⤶ end⤶ ⤶ end⤶ </code>⤶ <output>Every player 'driving' an entity will die a painful death.</output>⤶ ⤶ </example>