So I have a shop if the player buys a item it plays a audio but I don’t want it too play audio if the player has the audio
local Sounds = StarterGui.Sounds
local Shop = StarterGui.Shop
local PlayerGui = game.Players.LocalPlayer.PlayerGui
local Player = game.Players.LocalPlayer
local BearTrapStuff = PlayerGui.Shop.MainFrame.ItemInfo.BearTrapInfo
debounce=true
PlayerGui.Shop.MainFrame.BearTrap.MouseButton1Click:Connect(function()
BearTrapStuff.Buy.Visible = true
BearTrapStuff.BearTrapImage.Visible = true
BearTrapStuff.BearTrapInfo.Visible = true
BearTrapStuff.BearTrapPrice.Visible = true
end)
BearTrapStuff.Buy.MouseButton1Click:Connect(function(player)
if Player.leaderstats.Points.Value <500 then
else
if debounce == true then
debounce = false
game.StarterGui.Sounds.WiseChose:Play()
game.ReplicatedStorage.RemotesShop.BearTrap:FireServer(Player)
wait(3)
debounce = true
end
end
end)
if Sounds.WiseChose.IsPlaying then
-- do nothing
else
Sounds.WiseChose:Play()
end
Also, while quickly reviewing your code, you’re addressing things inside of StarterGui and inside of PlayerGui. Make sure you’re exclusively using things inside of PlayerGui.