not necessarily 100% related to scripting, however, i was making an rpg-like textbox that had text grunts play as each word scrolled on the screen. it sounds choppy when you play the singular sound over and over, so, is there a way to make it play over itself?
i've been told that i could make a new instance for it, but, would that need to be parented?
this is 100% client-side, if that's important.
local function textscroll(dialogue, voice)
if indialogue == false then
indialogue = true
dialoguebox.Visible = true
for i = 1, #dialogue do
local letter = string.sub(dialogue, i, i)
local nextletter = string.sub(dialogue, i + 1, i + 1)
dialoguetxt.Text = string.sub(dialogue, 1, i)
dialoguevoice:Play() --here's the sound that is being played. its choppy when it does play
wait()
if (letter == "," or letter == "." or letter == "!" or letter == "?") and nextletter ~= letter then
wait(0.2)
end
end
end
end

1 comment
thank you! this is very helpful!