Scripts/resources/[standalone]/dpemotes/client/Ragdoll.lua

30 lines
794 B
Lua
Raw Normal View History

2024-12-29 20:02:20 +00:00
if Config.RagdollEnabled then
RegisterCommand('+ragdoll', function() Ragdoll() end, false)
RegisterCommand('-ragdoll', function() StopRagdoll() end, false)
RegisterKeyMapping("+ragdoll", "Ragdoll your character", "keyboard", Config.RagdollKeybind)
local stop = true
function Ragdoll()
if IsInAnimation then return end
local ped = PlayerPedId()
if not IsPedOnFoot(ped) then return end
if Config.RagdollAsToggle then
stop = not stop
else
stop = false
end
while not stop do
SetPedToRagdoll(ped, 1000, 1000, 0, false, false, false)
Wait(0)
end
end
function StopRagdoll()
if Config.RagdollAsToggle then return end
stop = true
end
end