This is the script i have so far its not working (ive tried local and non local) (right now its in serverscript service but ive tried remote events, and putting it in the GUI and the audio still wont work) So what would fix this script?
game.StarterGui.Menu.Main_Menu.Menu_Background.Play_Button.Button.MouseButton1Click:Connect(function() print ("1") game.StarterGui.Menu.Sound2.Looped = false print ("2") game.StarterGui.Menu.Sound2.Playing = false print ("Music off") end)
First of all, you can't do anything with guis in a server script (to my knowledge), so go back to a local script.
Secondly, StarterGui replicated to PlayerGui, which is in the Player. This means any changes made to the StarterGui in a script will do NOTHING. You need to access the PlayerGui and change it through there. To do so:
local Player = game:GetService('Players').LocalPlayer local PlayerGui = Player:WaitForChild('PlayerGui') PlayerGui.Menu.Main_Menu.Menu_Background.Play_Button.Button.MouseButton1Click:Connect(function() print ("1") PlayerGui.Menu.Sound2.Looped = false print ("2") PlayerGui.Menu.Sound2.Playing = false print ("Music off") end)
TLDR: In scripts, access guis through PlayerGui, NOT StarterGui.
Let me know if you have any questions or if my provided code isn't working.