Just over a month ago, I posted a topic about how I couldn’t get my music script to work. I was making a script that would play a song when you stepped on a brick and would stop that song and play a new one when you stepped on a different brick. With some help, I got the script working perfectly. The link to the first post is below.
I returned to that script today so I could implement it into my game, only to find that it was broken. The two bricks and the script are in a separate testing game. One of the songs would not play at all in Studio when I clicked the preview button (it must have been deleted) and the other song would. Neither brick, however, would play the song it was supposed to play when I touched them in playtest.
I took the songid from the working song and put it into the actual game, and the preview wouldn’t even work there. I don’t have the slightest idea why this glitch is happening, and it’s annoying the crap out of me because I just fixed it the other week when it broke.
Pictures and script are below.
local sound = script.Parent.bruh local partsound = workspace.Red.san local part = script.Parent local red = workspace.Red local Debounce1 = false local Debounce2 = false part.Touched:Connect(function(Object) local plr = game.Players:GetPlayerFromCharacter(Object.Parent) if plr then if not Debounce1 then Debounce1 = true red.Transparency = 0 part.Transparency = 1 sound:Play() partsound:Stop() Debounce2 = false end end end) red.Touched:Connect(function(Hit) local plr = game.Players:GetPlayerFromCharacter(Hit.Parent) if plr then if not Debounce2 then Debounce2 = true part.Transparency = 0 red.Transparency = 1 sound:Stop() partsound:Play() Debounce1 = false end end end)