Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Client Side Audio?

Asked by
L43Q 48
9 years ago

How would I make a sound play for just a certain player (client side) instead of playing for the whole server?

1 answer

Log in to vote
0
Answered by 9 years ago

Just put the audio inside of the player and play that audio. This way only you hear the audio but not other players. To put the audio inside of the player, either put the audio in startergui/starterpack or clone and parent it to the player.


Final Product

This one does both, cloning and pasting and also looking for an audio already inside the player.

--Local Script
local audio = Instance.new("Sound")
local name = "Sound1"
local Id = 00000 --SoundId
local plyr = game:GetService("Players").LocalPlayer
if not plyr:FindFirstChild(name) and not plyr:FindFirstChild(name).SoundId = Id then
    audio.Parent = plyr
    audio.SoundId = Id
    audio.Name = name
end

Hope it helps!

0
Thank you so much :D. L43Q 48 — 9y
Ad

Answer this question