Revision as of 08:09, 1 May 2019 by Kenny2scratch (talk | contribs) (more forceful - I believe loud projects are against guidelines)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Document.png Please expand this article or section. You can help by adding more information if you are an editor. More information might be found in a section of the talk page. (August 2018)
Note Warning: Loud music can damage hearing. Do not use loud music in projects.

A sound on/off button may be useful when making a game that has music or sound that can be muted or stopped.

To make a sound on/off button, one will need a sprite in the form of a switch. The switch must provide two costumes, one to represent when sound is on, and the other to represent when sound is off.

when gf clicked
switch costume to [sound-on v]

when this sprite clicked
next costume
if <(costume #) = [2]> then //assuming the second costume is "off" and the first "on"
set volume to (0)% //if now off, turn off the volume
set volume to (100)% //if now on, turn on the volume

This script can be modified to allow the volume to be changed.

Note Note: When using this script, the sound will still play, just be silent. Due to this, the sound will not continue to where it was when it was stopped. Making a script to do this is extremely difficult, and has been suggested to have a block added for it multiple times.[1][2][3]

See Also


  1. topic:76378
  2. topic:74670
  3. topic:262977