isPedDucked | Multi Theft Auto: Wiki Skip to content

isPedDucked

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function checks if the specified ped is ducked (crouched) or not.

OOP Syntax Help! I don't understand this!

  • Method:ped:isDucked(...)
  • Variable: .ducked

Syntax

bool isPedDucked ( ped thePed )
Required Arguments
  • thePed: The ped to check.

Returns

  • bool: value

Returns true if the ped is ducked, false otherwise.

Code Examples

shared

This example checks if a random player is ducked or not, and if so displays a message in the chat box.

local players = getElementsByType ( "player" )
local randomPlayer = players[math.random(#players)]
if isPedDucked ( randomPlayer ) then
outputChatBox ( getPlayerName ( randomPlayer ) .. " is currently crouching." )
end

See Also