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

This doesn't seem to work anymore. I was tested it and it was working now It is not. Help?

local fullsound = workspace.Sound.FullSiteLockdownSound
local bool = true
local bool2 = true
local clearance = {
	["[SCP] Card-L5"] = true,
	["[SCP] Card-L4"] = true,
	["[SCP] Card-L3"] = false,
	["[SCP] Card-L2"] = false,
	["[SCP] Maksur"] = false,
	["[SCP] Card-L1"] = false,
	["[SCP] Card-Omni"] = true, 
	["[SCP] RS Card"] = false,
	["[SCP] O5-2 Access Card"] = true
}
script.Parent.Parent.FullSiteLockdown.touched:connect(function(touch)
	if touch.Name == "Handle" and clearance[touch.Parent.Name] and bool then
		if workspace.Sound.FullSiteLockdownSound.IsPlaying == false then
			workspace.Sound.FullSiteLockdownSound.Volume = "1"
			fullsound:Play()
			wait(7)
			workspace.Sound.FullSiteLockdownSound.Playing = true
			workspace.Sound.FullSiteLockdownSound.Volume = "0"
		else
			wait(7)
			workspace.Sound.FullSiteLockdownSound.Playing = false
			workspace.Sound.FullSiteLockdownSound.Volume = "1"
		end
end
end)


4 comments

0

Did you make any script changes or Instance changes?

0

May be something to do with ROBLOX studio, it works fine with a restart

0

mk

0

Update. It only works once it turns out. Any ideas?

1 answer

local fullsound = workspace.Sound.FullSiteLockdownSound
local bool = true
local bool2 = true
local clearance = {
	["[SCP] Card-L5"] = true,
	["[SCP] Card-L4"] = true,
	["[SCP] Card-L3"] = false,
	["[SCP] Card-L2"] = false,
	["[SCP] Maksur"] = false,
	["[SCP] Card-L1"] = false,
	["[SCP] Card-Omni"] = true, 
	["[SCP] RS Card"] = false,
	["[SCP] O5-2 Access Card"] = true
}
script.Parent.Parent.FullSiteLockdown.touched:connect(function(touch)
	if touch.Name == "Handle" and clearance[touch.Parent.Name] and bool then
		if workspace.Sound.FullSiteLockdownSound.IsPlaying == false then
			fullsound:Stop()
			wait(0.1)
			fullsound:Play()
			wait(8)
			fullsound:Stop()
			wait(1)
			workspace.Sound.FullSiteLockdownSound.Playing = true
			workspace.Sound.FullSiteLockdownSound.Volume = "0"
		if workspace.Sound.FullSiteLockdownSound.IsPlaying == true then
			wait(8)
			workspace.Sound.FullSiteLockdownSound.Playing = false
			workspace.Sound.FullSiteLockdownSound.Volume = "1"
		end
		
		end
end
end)


This seems to have fixed it. It wasn't stopping the sound for some reason

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