I’m trying to use the type writer effect shown in this article, but after adding the “voiceClone” part (shown below), there seems to be some issues with it
The problem is that in Studio, the sounds play just fine, but when I get into an actual game, the sounds are all choppy and it’s not consistent
It only seems to be a problem when I use the wait() function, because it’s very consistent and fast if I remove it, as voiceClone.Ended:Wait() is there, which doesn’t seem to behave how wait() does, however I can’t only use voiceClone.Ended:Wait(), since it goes too fast
for f, l in utf8.graphemes(newCaption) do
index = index+1
Caption.MaxVisibleGraphemes = index
local voiceClone = Voice:Clone()
voiceClone.Parent = script
voiceClone.PlaybackSpeed = math.random(5, 9)
voiceClone:Play()
voiceClone.Ended:Wait()
debris:AddItem(voiceClone, .1)
wait(0.03)
end
(not sure if this is the right place, just wondering if there is another way to yield the loop, that doesn’t make the sound inconsistent)
It could work but if he want to make so the whole server hear it then, he would need to use RemoteEvent which exploiter can use to play sound to all the server.
thank you, after playing a bit around I got it to work with this code:
newCaption = newCaption:gsub("<br%s*/>", "\n")
newCaption:gsub("<[^<>]->", "")
for f, l in utf8.graphemes(newCaption) do
index = index+1
Caption.MaxVisibleGraphemes = index
local voiceClone = Voice:Clone()
voiceClone.PlaybackSpeed = math.random(5, 9)
game:GetService("SoundService"):PlayLocalSound(voiceClone) -- thanks
debris:AddItem(voiceClone, voiceClone.TimeLength)
wait(0.03)
end