Skip to content

isPedHeadless

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

Returns true if the ped is headless, false otherwise.

  • bool: value

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