so i have this modulescript here that will check if the last character in the text is a period, question mark, exclamation point, comma, colon, or semicolon, but for some reason, it's marking every character as a period/question mark/exclamation point. i think this might have to do with the or statements? here's the code:
local player
wait(1)
player = game.Players:FindFirstChildWhichIsA("Player")
local db = player.PlayerGui.ScreenGui.DialogueBox
function Dialogue(text)
for i=0,string.len(text) do
db.Text.Text = string.sub(text, 1, i)
player.PlayerGui.Beep:Play()
if string.sub(db.Text.Text, string.len(db.Text.Text)) == "." or "?" or "!" then
wait(1)
elseif string.sub(db.Text.Text, string.len(db.Text.Text)) == "," or ";" or ":" then
wait(0.5)
end
wait()
end
wait(1)
game.ReplicatedStorage.DProgressed.OnServerEvent:Wait()
end
return Dialogue

1 comment
it worked, thank you!