I don't know if I messed something up, but it does not work at all. Can someone help me debug it? (It uses a click detector)
local debounce = false function onClicked() local s = Instance.new("Sound") s.Name = "Sound" s.SoundId = "http://www.roblox.com/asset/?id=131558930" s.Volume = 0.5 s.Looped = false s.archivable = false s.Parent = game.Workspace local debounce = true s:play() wait(2.5) local debounce = false end script.Parent.ClickDetector.MouseClick:connect(onClicked)
local debounce = false function onClicked() if not debounce then local s = Instance.new("Sound") s.SoundId = "rbxassetid://131558930" -- SoundId's use this link format s.Volume = 0.5 s.Looped = false s.Archivable = false -- archivable is deprecated, switch to Archivable s.Parent = game.Workspace debounce = true -- don't add the local s:Play() -- :play is deprecated, switch to :Play wait(2.5) debounce = false end end script.Parent.ClickDetector.MouseClick:Connect(onClicked)