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

How can I make this sound work?

Asked by 10 years ago

How can I make the sound part of this script work? Also is that debounce right?

Spawner = script.Parent.Parent.SpawnLocation
Flag = script.Parent.Parent.Flag

function onTouch(hit)
script.Parent.Capturesound:Play() -- this is where I need help
script.Parent.Capturesound.Volume = 1 -- is 1 the highest volume it can go?
local user = game.Players:GetPlayerFromCharacter(hit.Parent) 
if user ~= nil then 
Spawner.Neutral = false
Spawner.BrickColor = user.TeamColor
Spawner.TeamColor = user.TeamColor
script.Disabled = true
debounce(5) --is this debounce right?
script.Disabled = false
end 
end 

script.Parent.Touched:connect(onTouch)

1 answer

Log in to vote
0
Answered by 10 years ago

Is there any output? If there is please list them

Debounce is used like this:

local debounce = false-- Debounce can be name anything
function Blablah()
    if debounce == false then
        debounce = true
        --Code
        wait(5)
        --Code after 5 seconds
        debounce = false
    end
end

Visit http://wiki.roblox.com/index.php?title=Debounce for more information

Ad

Answer this question