Im making this script, where it shows the dialogue frame, shows the text and then closes.
The problem is that when you open 2 dialogues in a very close time, it closes the dialogue frame before it should.
function dialogue(player,text)
if player == plr then
gameGUI.DialogueFrame.Visible = true
gameGUI.DialogueFrame.Text.Text = ""
for i = 1, #text do
gameGUI.DialogueFrame.Text.Text = gameGUI.DialogueFrame.Text.Text .. text:sub(i, i)
game.ReplicatedStorage.Effects.GenericBeepSFX:Play()
if text:sub(i, i) == "." or text:sub(i, i) == "!" or text:sub(i, i) == "?" then
wait(0.5)
elseif text:sub(i, i) == "," then
wait(0.3)
end
wait(0.02)
end
wait(2)
gameGUI.DialogueFrame.Visible = false -- HERE
end
end