[Release] Simple Ragdoll Script

I’m working on making my first script, to allow a player to ragdoll with the push of a button (similar to how you can press 1 on the numpad using enhanced reborn trainer).

I’m curious if this would be the correct thing to use:
SET_HIGH_FALL_TASK

Any help is appreciated.

BOOL SET_PED_TO_RAGDOLL(Ped ped, int time1, int time2, int ragdollType, BOOL p4, BOOL p5, BOOL p6)

@Mr.Scammer Thanks! Now I just need to try a few things to see if I’m doing this right. So do values need to be added to this or is it ready to use? I’m learning as I go…

Basically I want the script to act the same as pressing 1 on the numpad, causing the player to ragdoll and stay in that state until the assigned key is released.

No, you’d have to add the specified arguments. Also make sure Numpad 1 is a mapped key, because unmapped ones won’t work currently.

I won’t be using keypad 1, was just giving an example of how the trainer option for ragdoll works.

While on foot, press and hold U to ragdoll (or using a controller, UP on the D-Pad), release to stand back up. This script is meant to replace the ragdoll option on the Enhanced Reborn Trainer as that one is not synced for all players (yet!).

client.lua

Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsControlPressed(1, 303) then
SetPedToRagdoll(GetPlayerPed(-1), 1000, 1000, 0, 0, 0, 0)
end
end
end)

__resource.lua

client_script ‘client.lua’