So I’m making a dialog UI system for an NPC. When the UI appears and the text changes and appears, a sound effect like it’s typing it out.
Right now I’m having an issue where the sound plays correctly, but the audio is played in the workspace allowing everyone to hear the clicking sound effect which I don’t really want. Is there any way for the audio to be played to the local player who activated the UI?
Here’s the function.
function SoundEffect()
local Sound = Instance.new("Sound", workspace)
Sound.Name = "TextSound"
Sound.SoundId = "http://www.roblox.com/asset/?id=3333976425"
Sound.PlaybackSpeed = 0.8
Sound.Volume = 1
Sound.Volume = 1
Sound:Play()
coroutine.resume(coroutine.create(function()
wait(1)
Sound:Destroy()
end))
end
If anyone knows any ways to get around this, that’ll be great. Thanks!