Editable Files

client/editable.lua

function disableKeys()
    DisableAllControlActions(0)
    EnableControlAction(0, 249, true)
    EnableControlAction(0, 1, true)
    EnableControlAction(0, 2, true)
    EnableControlAction(0, 32, true)
end

function open()
    sendNui("app-main", "open")
    SetNuiFocus(true, true)
end

function close()
    SetNuiFocus(false, false)
end

RegisterNetEvent("tgiann-musical-chairs:musicStatus")
AddEventHandler("tgiann-musical-chairs:musicStatus", function(play, data)
    if config.soundScript == "tgiann-sound" then
        if play then
            TriggerEvent("tgiann-sounds:play-sound", {
                name = data.key,
                coord = data.coord,
                youtube = data.music,
                checkDistance = true,
                maxDistance = 50,
                soundMaxVolume = 0.4,
                loop = true,
            })
        else
            TriggerEvent("tgiann-sounds:stop-sound", {
                name = data.key
            })
        end
    elseif config.soundScript == "xsound" then 
        if play then
            exports["xsound"]:PlayUrlPos(data.key, data.music, 0.4, data.coord, true)
            exports["xsound"]:Distance(data.key, 50.0)
        else
            exports["xsound"]:Destroy(data.key)
        end
    end
end)

server/commands.lua

language files

Last updated