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

How play a local sound on touched?

Need help. I need music to player when a brick is touched, however only play locally (so that other players cannot hear it). I've kind of done it, however it works in "Test" mode, but not in an actual server. Any help is greatly appreciated.

UPDATE: Here are the scripts I have. And yes, I said scripts, as in plural, because I'm using multiple scripts to do something that probably only requires one script :P.

So, basically, I have music located inside of workspace. Theres a part, and when a player touches it, it fires this script:

function touched()
	game.Players.LocalPlayer.PlayerGui.moosic.Value = "run"
end
script.Parent.Touched:connect(touched)

"moosic" is a string value located inside of StartGui, which i need to access PlayerGui in order to change it in-game. The Value changes to "run", and another script inside StarterPack senses when its changed via this script:

wait(1)
m = game.Players.LocalPlayer.PlayerGui.moosic
print("ok")
m.Changed:connect(function()
	if m.Value == "run" then
		game.Workspace.moosic1:Play()
	end
end)

Like I said, it works in "test", but not in an actual server. I'm sure this is a lot more complex than it needs to be, so any help is appreciated.

3 comments

1

can you give us the progress you have...

1

This isn't a request site.

0

Echoes This isn't a Reuqest site...

1 answer

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