Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Sounds are not playing, even though they have been preloaded?

Asked by 9 years ago

Update: Moving the :Play() command to outside the loop fixed it, I guess it was attempting to play over and over again.

Basically I am trying to play a song, but it doesn't work. What is strange is that the rolling sound, which is played at the exact same time, does work but the song does not. The sound is in PlayerGui, like all the other sounds. It does not work when played manually from the commadn bar either. I get this error in the output after about 60 seconds:

httpGet http://www.roblox.com/asset/?id=190899898 failed. Trying again. Error: (unknown): InternetQueryDataAvailable, err=0x2EE2.  Elapsed time: 118.464

Here are the parts of the script involving the sounds, it is a local script.

Preloading:

Assets = {190841442,190841433,190841418,190837281,190899898,190899782} 
for _, asset in ipairs(Assets) do
     game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=" .. asset)
end
print("Sounds Loaded")

Playing:

while wait() do
    if CType == "Ball" then 
        Player.PlayerGui.RoboWestern:Play()
        Player.PlayerGui.Roll:Play()
        game.Players.LocalPlayer.Character.Torso.BodyPosition.maxForce = Vector3.new(10000,10000,10000)
        game.Players.LocalPlayer.Character.Torso.BodyPosition.position = game.Workspace.Ball.Position + Vector3.new(0,7.5,0)
        game.Workspace.Ball.BodyVelocity.velocity = game.Workspace.Ball.BodyVelocity.velocity:Lerp((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * Vector3.new(100,0,100)* game.Workspace.Ball.Multiplier.Value * game.Workspace.Ball.MultiplierTwo.Value),1)
        for _,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
            if v:IsA("Part") then
                v.Transparency = 1
                if v:FindFirstChild("face")then
                    v.face:Destroy()
                elseif v:FindFirstChild("Roblox") then
                v.Roblox:Destroy()
                end
            elseif v:IsA("Hat") then
                v.Handle.Transparency = 1
            elseif v:IsA("Shirt") or v:IsA("Pants") then
                v:Destroy() 
            end
        end
    else
        Player.PlayerGui.Roll:Stop()
        Player.PlayerGui.RoboWestern:Stop()
        game.Players.LocalPlayer.Character.Torso.BodyPosition.maxForce = Vector3.new(0,0,0)
        game.Workspace.Ball.BodyVelocity.velocity = game.Workspace.CurrentCamera.CoordinateFrame.lookVector * Vector3.new(0,0,0)
    end 
end
0
I honestly don't see any problems. The error shows it's probably a problem with the preloading. Was this error text in red or yellow? Tkdriverx 514 — 9y
0
It was in Yellow text. Everything else, including all the other sounds, work fine. Spectrabox 15 — 9y

Answer this question