Redon-Tech / Emergency-Vehicle-Creator

Emergency Vehicle Creator is a Roblox plugin to simplify the creation of emergency lights on vehicles. This plugin is heavily inspired by Siren Tool by Dawnstar Fivem.
https://evc.redon.tech
MIT License
9 stars 2 forks source link

Overriding other sirens does not stop the other sirens properly #21

Closed parker02311 closed 1 week ago

parker02311 commented 1 week ago
    if sirenData.overrideOtherSounds then
        if sirenData._type == "hold" then
            for _, v in pairs(soundPart:GetChildren()) do
                if v:IsA("Sound") and v ~= sound then
                    if v:GetAttribute("OriginalVolume") == nil then
                        v:SetAttribute("OriginalVolume", v.Volume)
                    end
                    v.Volume = 0
                end
            end
        else
            for _, v in pairs(soundPart:GetChildren()) do
                if v:IsA("Sound") and v ~= sound then
                    v:Stop()
                end
            end
        end
    end

Should check if the siren is actually a siren and then use the stopSiren function

MatthiasTHM commented 1 week ago

I added that in the EVC plugin script, but my override light pattern stays stuck when I switch to a different siren until I actually turn off the siren that does the override pattern.

parker02311 commented 1 week ago

I added that in the EVC plugin script, but my override light pattern stays stuck when I switch to a different siren until I actually turn off the siren that does the override pattern.

This code snippet is the bug, that is why.