local dropAmount = 50000
local isEnabled = false
function DropMoney(playerPos)
if isEnabled then
local moneyPickup = CreatePickup("PICKUP_MONEY_CASE", playerPos.x, playerPos.y, playerPos.z, 0, dropAmount)
Citizen.Wait(5000)
RemovePickup(moneyPickup)
end
end
local function OnVehicleExploded()
local playerPed = GetPlayerPed(-1)
local playerPos = GetEntityCoords(playerPed)
DropMoney(playerPos)
end
RegisterCommand("toggleMoneyDrop", function(source, args, rawCommand)
isEnabled = not isEnabled
if isEnabled then
TriggerEvent("chat:addMessage", {
color = {255, 0, 0},
multiline = true,
args = {"Money Drop", "Money drop feature enabled!"}
})
-- Listen for vehicle explosion event
AddEventHandler("explosionEvent", OnVehicleExploded)
else
TriggerEvent("chat:addMessage", {
color = {255, 0, 0},
multiline = true,
args = {"Money Drop", "Money drop feature disabled!"}
})
-- Remove the event listener
RemoveEventHandler("explosionEvent", OnVehicleExploded)
end
end)
To embed this project on your website, copy the following code and paste it into your website's HTML: