killPed
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 kills the specified ped.
OOP Syntax Help! I don't understand this!
- Method:ped:kill(...)
Syntax
bool killPed ( ped thePed, [ ped theKiller = nil, int weapon = 255, int bodyPart = 255, bool stealth = false ] )Required Arguments
- thePed: The ped to kill
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.
- theKiller (default: nil): The ped responsible for the kill
- weapon (default: 255): The ID of the weapon or Damage Types that should appear to have killed the ped (doesn't affect how they die)
- bodyPart (default: 255): The ID of the body part that should appear to have been hit by the weapon (doesn't affect how they die) 3: Torso 4: Ass 5: Left Arm 6: Right Arm 7: Left Leg 8: Right Leg 9: Head
- stealth (default: false): Boolean value, representing whether or not this a stealth kill
Returns
- bool: value
Returns true if the ped was killed, false if the ped specified could not be killed or is invalid.
Code Examples
shared
Example 1:This simple example adds akillcommand to commit suicide.
function commitSuicide ( sourcePlayer ) -- kill the player and make him responsible for it killPed ( sourcePlayer, sourcePlayer )end-- attach our handler to the "kill" commandaddCommandHandler ( "kill", commitSuicide )See Also
Ped Functions
- addPedClothes
- canPedBeKnockedOffBike
- createPed
- getPedAmmoInClip
- getPedAnalogControlState
- getPedAnimation
- getPedArmor
- getPedBonePosition
- getPedCameraRotation
- getPedClothes
- getPedContactElement
- getPedControlState
- getPedFightingStyle
- getPedGravity
- getPedMoveState
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedOxygenLevel
- getPedSimplestTask
- getPedStat
- getPedTarget
- getPedTargetCollision
- getPedTargetEnd
- getPedTargetStart
- getPedTask
- getPedTotalAmmo
- getPedVoice
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponMuzzlePosition
- getPedWeaponSlot
- getValidPedModels
- givePedWeapon
- isPedBleeding
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDoingTask
- isPedDucked
- IsPedFootBloodEnabled
- isPedHeadless
- isPedInVehicle
- isPedOnGround
- isPedReloadingWeapon
- isPedTargetingMarkerEnabled
- isPedWearingJetpack
- killPed
- playPedVoiceLine
- reloadPedWeapon
- removePedClothes
- removePedFromVehicle
- resetPedVoice
- setPedAimTarget
- setPedAnalogControlState
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedBleeding
- setPedCameraRotation
- setPedCanBeKnockedOffBike
- setPedChoking
- setPedControlState
- setPedDoingGangDriveby
- setPedEnterVehicle
- setPedExitVehicle
- setPedFightingStyle
- setPedFootBloodEnabled
- setPedGravity
- setPedHeadless
- setPedLookAt
- setPedOxygenLevel
- setPedStat
- setPedTargetingMarkerEnabled
- setPedVoice
- setPedWalkingStyle
- setPedWeaponSlot
- setPedWearingJetpack
- warpPedIntoVehicle