Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to mute and unmute music for one person?

Asked by 9 years ago

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)
0
Play the music client-side User#2263 0 — 9y
0
I can actually make a model for you if you would want. EzraNehemiah_TF2 3552 — 9y
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! alphawolvess 1784 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

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.

0
More efficient to pause instead of mute if you can. http://wiki.roblox.com/index.php?title=API:Class/Sound/Pause User#2263 0 — 9y
0
How would he make the music mute? What variable is sound? This answer isn't going to be accepted. EzraNehemiah_TF2 3552 — 9y
Ad

Answer this question