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

How to play a sound to only one person?

Asked by
lucas4114 607 Moderation Voter
9 years ago

Sooo... I need help, I got a GUI button, I made it play a click sound when pressed (And all that other code that makes it do what it was ment for, but ignore that.) So, how would I play that sound to only the person who clicked the button on the screen GUI?

function onClick()
    script.Parent.Sound:Play() -- This is where I needed help!.....
    script.Parent.Parent.BadgesButton.Visible = false
    wait(0.07)
    script.Parent.Parent.InfoButton.Visible = false
    wait(0.07)
    script.Parent.Parent.HelpButton.Visible = false
    wait(0.07)
    script.Parent.Parent.UpdatesButton.Visible = false
    wait(0.08)
    script.Parent.Parent.PlayButton.Visible = false
    wait(0.1)
    script.Parent.Parent.Title.Visible = false
    wait(0.1)
    script.Parent.Parent.Parent.UpdateMenu.Visible = true
    wait(0.06)
    script.Parent.Parent.Parent.UpdateMenu.BackButton.Visible = true
    wait(0.06)
    script.Parent.Parent.Parent.UpdateMenu.TextLabel.Visible = true
end

script.Parent.MouseButton1Click:connect(onClick)
0
This is a REPEATED question. Please search your question on this site before posting one! alphawolvess 1784 — 9y

1 answer

Log in to vote
1
Answered by
dyler3 1510 Moderation Voter
9 years ago

The only thing that you have to do for this, is simply put the sound inside the players PlayerGui. So, if you're in Studio, move the sound into the StarterGui, and it should work fine. If you have any questions, let me know in the comments. Hope I helped :P

Ad

Answer this question