For a small game, there is a menu gui and a sound should be playing while in this menu until you click “Play”. This worked before, but I soon stopped working on the build. Once I picked up the build again, the sound no longer plays in the menu. I am positive that the sound I’m using wasn’t removed by Roblox, so I’m assuming that this is the result of the script, and that its possible that small changes were made to Lua that rendered my script useless. Here is the script below:
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
local Play = script.Parent.Sidebar.Play
repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = workspace.CameraPart.CFrame
Play.MouseButton1Click:Connect(function()
Camera.CameraType = Enum.CameraType.Custom
script.Parent.Parent:Destroy()
end)
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://6657098363"
sound.Parent = game:GetService("SoundService")
sound:Play()
Play.MouseButton1Click:Connect(function()
sound:Pause()
sound:Destroy()
end)
you can put a print or warn right under this part
like
warn(‘TESTING SCRIPT HERE’)
if it goes past the repeat loop then you will see the print if not you won’t see anything
you could also put this at the bottom of the script to know the full script loaded which i do on some of my major scripts sometimes like warn(‘Local Sound Script Loaded’)
Thank you, I was able to see the warn under the repeat and I found out in the script output that my place, for some reason, needed to give permission to use the sound I was using. This now works and my menu is back to normal. Thank you for your help!