Why is this script not working properly
The script is in StarterCharacterScripts and it is a localscript.
In the script, a new Sound should be added to the player whenever the player resets.
Any help is greatly appreciated!
Here is the coding for the script:
local Player = game.Players.LocalPlayer
if Player.PlayerGui:FindFirstChild("SoundFixGui"):FindFirstChild("BGM") ~= nil then
--Do Nothing
else
local BackgroundMusic = Instance.new("Sound")
BackgroundMusic.Parent = Player:FindFirstChild("PlayerGui"):FindFirstChild("SoundFixGui")
BackgroundMusic.Name = "BGM"
BackgroundMusic.Looped = true
BackgroundMusic.SoundId = "rbxassetid://256165333"
BackgroundMusic:Play()
end
script:Destroy()

1 comment
When you play, is the script still in StarterCharacterScripts? Take out script:Destroy() if it is