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

How to make Personal Audio?

Hello, I've been experimenting with sound, though I've ran into a bit of a problem. I'm making a song playlist, and it plays different songs based on what you click. My current script works, though I would prefer it to only play to the player who clicked the button. Currently, it plays to everyone.

Essentially, I want the song playing only to the person who clicked, rather than everyone.

Currently I have this script:

radioactive = game.Workspace.radioactive
happy = game.Workspace.happy
function radioactiveF()
	if radioactive.IsPlaying ~= true then
		happy:Stop()
		radioactive:Play()
	else
		radioactive:Pause()
	end
end

function happyF()
	if happy.IsPlaying ~= true then
		radioactive:Stop()
		happy:Play()
	else
		happy:Pause()
	end
end

script.Parent.radioactive.MouseButton1Click:connect(radioactiveF)
script.Parent.happy.MouseButton1Click:connect(happyF)

1 answer

Put the sounds in the PlayerGui, If they are in the Player or PlayerGui they play for the player only

radioactive = script.Parent.Parent.Parent.Parent.radioactive --Im not sure the hierearchy, but this is just what im putting
happy = script.Parent.Parent.Parent.Parent.happy
function radioactiveF()
    if radioactive.IsPlaying ~= true then
        happy:Stop()
        radioactive:Play()
    else
        radioactive:Pause()
    end
end

function happyF()
    if happy.IsPlaying ~= true then
        radioactive:Stop()
        happy:Play()
    else
        happy:Pause()
    end
end

script.Parent.radioactive.MouseButton1Click:connect(radioactiveF)
script.Parent.happy.MouseButton1Click:connect(happyF)

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