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

How to mute and unmute music for one person?

I builded up a script but i wont work I want when player clicks on mute button the music will mute but not for everyone in the server just that player. Can you help me? Thanks.

game.Players:connect(function(p)
stopped = false
sound = game.Workspace.MusicScript.Sound
script.Parent.Text = "Mute Music"
script.Parent.MouseButton1Down:connect(function(p)
    if stopped == true then
        sound:Play()
        stopped = false
        script.Parent.Text = "Mute Music"
    else
        sound:Pause()
        stopped = true
        script.Parent.Text = "Unmute Music"
    end
end)

3 comments

0

Play the music client-side

0

I can actually make a model for you if you would want.

0

When you go into studio; test it so your character appears. Then look in Players>Player> then look at those directories, or for roblox, Folders. What you see are very useful ! Experiment with scripts!

1 answer

✓ Accepted answer

Put the music in the Player's PlayerGui and insert a script inside the sound that checks a value in workspace. Once that changes to true then it will play unless it is muted. When it changes to false then it will stop. What I do to mute the song is

sound.Volume = 0

so that way it won't interfere with the mutescript.

I won't make the scripts for you.

2 comments

0

More efficient to pause instead of mute if you can. http://wiki.roblox.com/index.php?title=API:Class/Sound/Pause

0

How would he make the music mute? What variable is sound? This answer isn't going to be accepted.

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