I want to locally play music through clicking a TextButton on a surface GUI. The sound would only play for the player who clicked.
First, you should probably make sure the sound is in the player. You can do this by copying the sound and placing it into the local player. There are other ways, but I found this most simple. Next, just play the sound using a local script. That's all you have to do really. Here's some example code below,
--- Make sure this is in a local script local player = game.Players.LocalPlayer--Can only do this with a local script local sound = game.ServerStorage:WaitForChild("Sound") -- define the sound local SoundCopy = sound:Clone() -- clone the sound SoundCopy.Parent = player -- put it in the local player SoundCopy:Play() -- play the copy
Hope that helped! Good luck!