Anyone know how to use 'IsExplosionInSphere or IsExplosionInArea'

Hello, can someone please put me in the right direction how ‘IsExplosionInSphere or IsExplosionInArea’ event can be used? there is literally no scripts out there that uses it so i can’t use that as an example to try and figure it out and the docus and things that i can find about it, i just don’t understand… Haven’t been doing lua for long so still trying to understand and probably want to make something that is a little above my head…

Hey :slightly_smiling_face:
I’m just speculating (I’ll probably run some test I’m curious to know too now), but my guess is that IsExplosionInSphere() is pretty much the same as IsExplosionInArea() they both check if an explosion occured in the zone you defined, if so it returns true, if not it returns false. The difference being that one check in spheric zone the other one in a squared zone.

Yeahh that’s how far i was too, but how to use it no idea haha. Do you maybe know what i’m doing wrong here?

Citizen.CreateThread(function()

while true do

    Citizen.Wait(1)

    if IsExplosionInSphere(num, 1396.06, -746.13, 67.21, 1000.0) then

        ExecuteCommand("command")

 end

end)

Looks good to me, did you make sure the id of the explosion you are using (num) is valid and the right one (seems like each type explosion as a different one related to her source) ?
You have the list of all the explosions in the Native AddExplosion() doc

Yeah super weird, still doesn’t work if i change the ‘num’ to ‘2’ (stickybomb)

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(1)
        if IsExplosionInSphere(9, 1396.06, -746.13, 67.21, 99999.0) then
            print("success")
        end
    end
end)

this worked for me