SetPedMinGroundTimeForStungun
DocsSetPedMinGroundTimeForStungun(ped, minTimeInMs)Description
Overwrites the minimum time the ped will stay on the ground for after being stunned. Setting this while the ped is stunned will not alter the duration of the current stun but will still effect future stuns.
Passing -1 into the second parameter minTimeInMs will reset the modifier, making it use the weapons original DamageTime as the stun duration (see update/update.rpf/common/data/ai/weapons.meta)
NOTE: Unlike what the native name implies, this works on any weapon that has its DamageType in the weapons.meta set to ELECTRIC.
Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | The ped to set the min ground time for |
minTimeInMs | int | The minimum time the stun should last in milliseconds. |
Quick Snippet: Get Ped Handleped
pedUse this to get the player ped handle for this native.
-- Get the player's ped handle (client-side)
local ped = PlayerPedId()
print("Ped handle: " .. ped)
-- For a specific player's ped (server-side):
-- local targetPed = GetPlayerPed(source)Ped Models

mp_m_freemode_01
player_zero
ig_agatha
s_m_y_cop_01
s_m_m_gaffer_01
g_m_m_armboss_01
a_c_boar
a_m_m_bevhills_01Returns
voidThis native does not return a value.
Examples
Official
-- This sets the minimum stun ground time for the player's ped to 10 seconds (and re-applies it if the player's ped changes)
local currentPed = 0
CreateThread(function()
while true do
local playerPed = PlayerPedId()
-- Checks if the player ped has changed
if currentPed ~= playerPed then
currentPed = playerPed
-- Sets the minimum stun ground time to 10 seconds
SetPedMinGroundTimeForStungun(currentPed, 10000)
end
Wait(1000)
end
end)