Add Sound objects, load audio with a SoundId, and play effects where the player can actually hear them.
A game with no sound feels like a movie with the volume off. Sounds are objects — you create them, give them audio to play, and trigger them at exactly the right moment.
A Sound object needs a SoundId (the audio file) before it can play:
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://123456789" -- a real sound ID
sound.Volume = 0.5
sound.Parent = part
sound:Play()
SoundId — which audio file. Sound IDs look like rbxassetid://123456. Upload your own audio to your account (or use free ones from the toolbox), copy its ID, and paste it. The placeholder number above won't play anything — swap in a real ID.Volume — how loud (0 to 1).:Play() — start it.Or, if you placed a Sound object in Studio, just grab it and play: workspace.Coin:WaitForChild("CoinSound"):Play().
The property that points a Sound object at its audio file is .
Here's the catch: sounds are heard per-player. A :Play() on the server is silent to clients unless it's replicated — and that's a mess you don't need.
For feel-effects — a coin pop, a button click, a jump — play them on the client:
-- LocalScript
coin.ClickDetector.MouseClick:Connect(function()
coin.Sound:Play() -- you'll hear it on your own client
clickEvent:FireServer()
end)
The coin sound is feel, and feel is per-player. So it fires client-side, while the coin reward stays server-side. One click, two layers.
Where should a coin-pickup sound play?
Sounds have the usual controls:
sound:Stop() -- stop playing
sound:SetAttribute("Playing", false) -- your own flag, if you like
For looping ambient audio — wind, waves, a busy street — set sound.Looped = true before :Play(). One sound object can loop forever until you :Stop() it.
A player collects a coin. Play the coin's sound on their client right before firing the reward. Write the play line.
coin.ClickDetector.MouseClick:Connect(function()
-- play the pickup sound
clickEvent:FireServer()
end)rbxassetid://123456 plays nothing. Use a real ID from the toolbox or your own upload.Looped = true for ambient audio.Next: smooth movement and polish — tweens.