Working on an APC remake from Half Life. I have the siren currently set to a click detector (though if someone could come up with a way to do it using a key once in the driver seat that'd be much better).
Anyway, right now the script for the siren is just
local on = false
script.Parent.ClickDetector.MouseClick:connect(function()
if on then
script.Parent.Siren:Stop()
on = false
else
script.Parent.Siren:Play()
on = true
end
end)
A way to make it slowly fade in and out on click would be appreciated. (As you can see, my scripting knowledge is very basic)

8 comments
That seems to simply turn it on and off still. Again, I'm pretty new at scripting so I'm not sure what's wrong with it.
I have edited it, if that is still not what you want then can you give more detail?
It's not "what I want" because that script is doing exactly the same thing my current one is. The volume is staying at 1 throughout. There's no fade or anything. The point was when you click it, the sound slowly starts up from 0.1 volume going up to 1 and staying there. When you click again, it goes from 1 back down to 0 and then stops.
That should do it.
You never added a wait to the loop... And I would use a coroutine to fade it in and out say it was a false alarm...
A coroutine would not make it seem any different, thank you for notifiying me about the wait. However, I did not deserve the downvote. I understand some people don't know how to properly use the voting feature.
You mean like whoever downvoted my question? I can't even vote, so if it was in response to that that was just dumb. Bu thanks for the negative rep over asking a question, isn't that what this site is for?
I downvoted your answer back then because it was wrong, plain and simple. You downvote answers that are wrong and upvote ones that are right. That's how it is meant to work. I'm removing the downvote now (as you corrected it).