I have the following script for a GUI and I want to use this sound http://www.roblox.com/asset/?ID=142448886
textButton = script.Parent textButton.MouseButton1Down:connect(function() if textButton.Text == "Open" then textButton.Text = "Close" textButton.BackgroundColor3 = Color3.new(1, 0, 0) elseif textButton.Text == "Close" then textButton.Text = "Open" textButton.BackgroundColor3 = Color3.new(0, 1, 0) end end)
local NAMEHERE = Instance.new("Sound") -- creates a new sound if you dont have it already NAMEHERE.SoundId = "http://www.roblox.com/asset/?id=142448886" -- inserts the id you gave me NAMEHERE.Parent = script.Parent -- puts the sound in the gui textButton = script.Parent - your script textButton.MouseButton1Down:connect(function() if textButton.Text == "Open" then textButton.Text = "Close" NAMEHERE:Play() -- or :Stop() my script textButton.BackgroundColor3 = Color3.new(1, 0, 0) elseif textButton.Text == "Close" then textButton.Text = "Open" NAMEHERE:Play() -- or :Stop() my script textButton.BackgroundColor3 = Color3.new(0, 1, 0) -- your script end end)