First things first, the if statement can be shortened (get rid of == true). Second of all, you're trying to check if the the BoolValue's value is true, however with your current code you actually end up checking if the BoolValue itself equals true. A BoolValue is, well, a BoolValue (an Instance), which doesn't equal true. A BoolValue's value (or any value type object for that matter) is stored in BoolValue.Value. You should also just use the BoolValue.Changed event, which will run quicker than waiting 1 second and also use less resources on the server. The .Changed event will also pass the new value.
Taking all these into account, you should end up with a script looking about like this:
local sound = script.Parent.Sound
script.Parent.Value.Changed:Connect(function(newValue)
if newValue then
sound:Play()
else
sound:Stop()
end
end)
On line 3, we connect the .Changed event to a new function, with the function taking one parameter, newValue (the event will pass the new value as this parameter). Then, on line 4, we check if newValue is true. == true is not necessary with bools, you can check if it's true simply with if bool then or if you want to check if it's false, use if not bool then. Any instance can be checked like this actually! If you were to provide a different variable type for example, it would check if it it is not nil (or if it is nil if you prefix it with not). The rest is a standard else statement.
5 comments
make sure it's true lol
It is true when I start the test...
it has to be false
I have turned it to false and it (OBVIOUSLY) does not play the audio.
yeah, i cant help you, the problem is that the value is false