local i=game:GetService("\083\111\117\110\100\083\101\114\118\105\099\101")local M=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local D=M:WaitForChild("\108\105\098")local p=require(D:WaitForChild("\080\105\122\122\097\065\108\112\097\099\097"))local x local K=p.GameModule:extend("\083\111\117\110\100")K.effectsGroup=nil K.musicGroup=nil function K.newSound(j,M,D,p,x,o)M=M or 12222058 D=D or.5 p=p or 1 x=x or i o=o or K.effectsGroup local w=Instance.new("\083\111\117\110\100")w.SoundId="\114\098\120\097\115\115\101\116\105\100\058\047\047"..M w.Volume=D w.Pitch=p w.SoundGroup=o w.Parent=x return w end function K.playSound(K,i,M,D,p,x)local o=K:newSound(i,M,D,p,x)o.Ended:Connect(function()o:Destroy()end)o:Play()return o end function K.playSoundAtCFrame(o,i,M,D,p,K)local j=Instance.new("\080\097\114\116")local w=o:newSound(i,M,D,j,K)j.CFrame=p or CFrame.new()j.Size=Vector3.new(1,1,1)j.Anchored=true j.CanCollide=false j.Material=Enum.Material.Air j.Transparency=1 j.Parent=x w.Ended:Connect(function()j:Destroy()end)w:Play()return w end function K.init(M)x=Instance.new("\070\111\108\100\101\114")x.Name="\115\111\117\110\100\098\105\110"x.Parent=workspace K.effectsGroup=Instance.new("\083\111\117\110\100\071\114\111\117\112")K.musicGroup=Instance.new("\083\111\117\110\100\071\114\111\117\112")K.effectsGroup.Parent=i K.musicGroup.Parent=i end return K
local SoundService = game:GetService("SoundService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local lib = ReplicatedStorage:WaitForChild("lib")

local PizzaAlpaca = require(lib:WaitForChild("PizzaAlpaca"))

local soundBin -- workspace sound bin

local Sound = PizzaAlpaca.GameModule:extend("Sound")

Sound.effectsGroup = nil
Sound.musicGroup = nil

function Sound:newSound(id,volume,pitch,source,group)
    id = id or 12222058
    volume = volume or 0.5
    pitch = pitch or 1
    source = source or SoundService
    group = group or Sound.effectsGroup

    local sound = Instance.new("Sound")

    sound.SoundId = "rbxassetid://"..id
    sound.Volume = volume
    sound.Pitch = pitch
    sound.SoundGroup = group

    sound.Parent = source

    return sound
end

function Sound:playSound(id,volume,pitch,source,group)
    local sound = self:newSound(id,volume,pitch,source,group)

    sound.Ended:Connect(function() sound:Destroy() end)

    sound:Play()

    return sound
end

function Sound:playSoundAtCFrame(id,volume,pitch,cframe,group)
    local sourcePart = Instance.new("Part")
    local sound = self:newSound(id,volume,pitch,sourcePart,group)

    sourcePart.CFrame = cframe or CFrame.new()
    sourcePart.Size = Vector3.new(1,1,1)
    sourcePart.Anchored = true
    sourcePart.CanCollide = false
    sourcePart.Material = Enum.Material.Air
    sourcePart.Transparency = 1

    sourcePart.Parent = soundBin

    sound.Ended:Connect(function() sourcePart:Destroy() end)

    sound:Play()

    return sound
end

function Sound:init()
    soundBin = Instance.new("Folder")
    soundBin.Name = "soundbin"
    soundBin.Parent = workspace

    Sound.effectsGroup = Instance.new("SoundGroup")
    Sound.musicGroup = Instance.new("SoundGroup")

    Sound.effectsGroup.Parent = SoundService
    Sound.musicGroup.Parent = SoundService
end

return Sound