Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I make this sound work?

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.