What I’m trying to achieve is making a great shop gui. When I click on the buy button it should play a sound determining if the the player has enough money or not. The issue is that the sounds won’t work. I check the sounds in the explorer and they work. I tried checking if there’s any errors in output and script analysis window and there’s no errors. If there is any ways to fix it please reply.
local Player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
local AllPlayer = Player.Parent:GetDescendants()
local Leader = Player.leaderstats
local GemCost = 40
local GoldCost = 100
local Sound = game:GetService("SoundService")
local Effect = game.Players:GetPlayers()
local Icon = game.StarterGui.Spells.Regen
script.Parent.MouseButton1Click:Connect(function(click)
if Leader.Gems.Value >= GemCost and Leader.Gold.Value >= GoldCost then
Sound.Reward2:Play()
Player.leaderstats.Gems.Value = Player.leaderstats.Gems.Value - GemCost
Player.leaderstats.Gold.Value = Player.leaderstats.Gold.Value - GoldCost
Icon.Visible = true
Icon.Time.Start.Disabled = false
else
Sound.NotEnough:Play()
end
end)