Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

How to Make a Part that Stops Audio Playing? [closed]

Asked by 9 years ago

I want to know how to make a part that makes audio stop playing. I already have a part that makes audio play and I used to scripts for that.

debounce = false

script.Parent.Touched:connect(function(hit)
if not debounce then
debounce = true
if(hit.Parent:FindFirstChild("Humanoid")~=nil)then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local Sound = script.Parent.Sound:Clone()
Sound.Parent = player.PlayerGui
Sound:Play()
wait(30)
end
debounce = false
end
end)

function ot(hit)
if hit.Parent ~= nil then
local player = game.Players:playerFromCharacter(hit.Parent)
if player ~= nil then
if player.leaderstats.Stage.Value == script.Parent.Name - 1 then
local h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
if h.Health ~= 0 then
player.leaderstats.Stage.Value = script.Parent.Name
end end end end end end

script.Parent.Touched:connect(ot)
0
You need to show your attempts before asking for something, this isn't a request site. Goulstem 8144 — 9y

Closed as Not Constructive by Goulstem, woodengop, and Spongocardo

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?