isPedHeadless | Multi Theft Auto: Wiki Skip to content

isPedHeadless

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.


With this function, you can check if a ped has a head or not.

Syntax

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

Returns

  • bool: value

Returns true if the ped is headless, false otherwise.

Code Examples

shared

Add a command to check whether the player is a zombie or not

function checkZombie(commandName)
local player = getLocalPlayer()
-- check whether the player is headless (a zombie)
local message = isPedHeadless(player) and "Yes, you are a zombie!" or "No, you aren't a zombie yet!"
outputChatBox(message)
end
addCommandHandler("zombie", checkZombie)

See Also