The title says it all, my sound is working in studio but when you play the real game it doesn’t play.
I tried printing if it is playing and it prints true.
Here is my code (Only look at sound bit)
local StarterGui = game:GetService("StarterGui")
local WarheadScreen = StarterGui.WarheadScreen
local WarheadFrame = WarheadScreen.WarheadFrame
local TouchedPart = script.Parent.Keycard.TouchedPart
local CountdownGui = script.Parent.Countdown
local Screen = CountdownGui.Screen
local WarheadStatus = Screen.Status
local Announcement = workspace.Announcement
local Siren = workspace.Siren
local BackgroundMusic = workspace.BackgroundMusic
local Activated = script.Activated
local Clearance = {
["Omni"] = true;
["L5"] = false;
["L4"] = false;
["L3"] = false;
["L2"] = false;
["L1"] = false;
}
TouchedPart.Touched:Connect(function(Hit)
if (Hit.Name == "Handle" and Clearance[Hit.Parent.Name]) and not Activated.Value then
Activated.Value = true
spawn(function()
WarheadStatus.TextColor3 = Color3.fromRGB(255, 170, 0)
local function ConvertNumbers(Seconds)
local Minutes = Seconds / 60
local Hours = Seconds / 3600
return string.format("%02d:%02d:%02d", Hours, Minutes % 60, Seconds % 60)
end
for i = 210, 0, -1 do
WarheadStatus.Text = ConvertNumbers(i)
wait(1)
end
end)
for _, light in pairs(workspace:GetDescendants()) do
if light:IsA("PointLight") then
light.Color = Color3.fromRGB(255, 0, 0)
light.Brightness = 3
light.Range = 12
light.Parent.Parent.Light1.Color = Color3.fromRGB(255, 0, 0)
light.Parent.Parent.Light2.Color = Color3.fromRGB(255, 0, 0)
end
end
Announcement:Play()
wait(1)
Siren:Play()
wait(Announcement.TimeLength + 0.5)
BackgroundMusic:Play()
wait(BackgroundMusic.TimeLength)
Siren:Play()
for i = BackgroundMusic.Volume, 0, -0.05 do
BackgroundMusic.Volume = i
wait()
if BackgroundMusic.Volume == 0 then
BackgroundMusic:Stop()
end
end
for i = 1, 0, 0.05 do
WarheadFrame.BackgroundTransparency = i
end
end
end)