Hello so i been trying to make when you collect a coin you can only hear it (locally) and not the entire server so please somebody send some help
local db = true
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
if db == true then
db = false
script.Parent.Transparency = 1
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 5
script.Sound:Play()
script.Parent.Transparency = 1
wait (13)
db= true
script.Parent.Transparency = 0
end
end
end)

2 comments
Yes you put the sound inside a local script so only the local player can hear it and then give the money value through a server script using a remote event.
i dont understand but thnaks