How to make sound play for local player

So i want to make a level up sound for only just the player but i can only hear it if i put the sound in workspace which plays for others, idk how else to do this.

This is my Datastore script in serverscriptservice.

local LEVELSOUND = game.Workspace.MW3

game.Players.PlayerAdded:Connect(function(player)
    Exp.Changed:Connect(function()
    		if level.Value == 100 then
    			level .Value = 100
    			Exp.Value = 0
    		elseif Exp.Value >= MaxExp.Value then
    			LEVELSOUND:Play()
    			Exp.Value = 0
    			MaxExp.Value = 1000
    			level.Value = level.Value + 1
    		end
    	end)
end)
3 Likes

You would play it in a place where only players can see (e.g in their PlayerGui) and not in a server side place like workspace.

3 Likes

If you want a sound to play for the local player only, you should use a RemoteEvent firing the client to play the sound.

2 Likes

You could just handle the audio playing on the client presuming the client has access to the Exp value, storing the sound somewhere only that client has access to.

SoundService has a function specifically designed for this

However, you will want a RemoteEvent to trigger it

13 Likes