Hello everyone, I would like to explode my player when i press a key. I found this script un LUA :
In this script when you die or you’r pressing “I” key, your player explode.
But i dont know how to convert it to CfxLUA

Can someone help me please?
EDIT : I finaly found how to do it. I was inspired by the script above
There is the script if someone want it
function explosion()
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
RequestWeaponAsset(GetHashKey("WEAPON_AIRSTRIKE_ROCKET"))
while not HasWeaponAssetLoaded(GetHashKey("WEAPON_AIRSTRIKE_ROCKET")) do
Wait(0)
end
RequestWeaponAsset(GetHashKey("WEAPON_STICKYBOMB"))
while not HasWeaponAssetLoaded(GetHashKey("WEAPON_STICKYBOMB")) do
Wait(0)
end
RequestWeaponAsset(GetHashKey("WEAPON_GRENADE"))
while not HasWeaponAssetLoaded(GetHashKey("WEAPON_GRENADE")) do
Wait(0)
end
RequestWeaponAsset(GetHashKey("WEAPON_RPG"))
while not HasWeaponAssetLoaded(GetHashKey("WEAPON_RPG")) do
Wait(0)
end
ShootSingleBulletBetweenCoords(coords.x, coords.y, coords.z, coords.x, coords.y, coords.z, 500, true,GetHashKey("WEAPON_PASSENGER_ROCKET"), ped, true, false, -1.0)
ShootSingleBulletBetweenCoords(coords.x, coords.y, coords.z, coords.x, coords.y, coords.z, 500, true,GetHashKey("WEAPON_RPG"), ped, true, false, -1.0)
ShootSingleBulletBetweenCoords(coords.x, coords.y, coords.z, coords.x, coords.y, coords.z, 500, true,GetHashKey("WEAPON_AIRSTRIKE_ROCKET"), ped, true, false, -1.0)
ShootSingleBulletBetweenCoords(coords.x, coords.y, coords.z, coords.x, coords.y, coords.z, 500, true,GetHashKey("WEAPON_STICKYBOMB"), ped, true, false, -1.0)
end
Citizen.CreateThread(function()
while true do
Citizen.Wait(100)
vie = GetEntityHealth(PlayerPedId())
if vie <= 10 then
explosion()
Citizen.Wait(3000)
end
end
end)
RegisterCommand("explode",function(source,args,rawCommand)
explosion()
end,false)
With this script your player explode when he’s dead or when you type /explode