The sound plays even if my value is set to false. How can I possible fix this?
repeat wait()
Button = script.Parent
until
Button.MouseButton1Down:connect(function(purchase)
local Sound = Instance.new("Sound") --The Cha-Ching Sound
Sound.SoundId = "http://www.roblox.com/asset/?id=131886985"
Sound.Parent = game.Lighting
local SoundToggle = script.Parent.Parent.Parent.SoundOnOff
if SoundToggle.Value == true then
if Sound.IsPlaying then
Sound:Stop()
else
Sound:Play()
end
elseif SoundToggle.Value == false then
--Sound Should Not Play If SoundToggle Value Is False
end
end)
