So I’ve made a textwriting effect but have problems to it
First,I want to make the ‘…’ play slower than the other word/letters
Secondly,I want to make sentences seperate with each other like what I did to the script,but it doesn’t work.
Here’s part of my script
local function typewrite (object , text )
for i = 1,#text,1 do
object.Text = string.sub (text,1,i)
wait (0.075)
end
end
typewrite (dialogue,"Oh no where's my cute lil' birdie?...")
wait(0.2)
typewrite (dialogue,"Oh hello there!") wait(0.1) ("Can you help me find my lil' bird?") wait(0.2) ("I'll give you this star I've got here to you in return.")
end
end)
Hello there. I’d like to point out an oopsie in the script, and also provide you with a solution to your problem.
This line will cause an error, as it constantly creates new environments without the functions calling them.
The solution:
You can use a bool value to truncate the text.
local dialogue = script.Parent
local function typewrite (object , text, truncateBool )
for i = 1,#text,1 do
object.Text = string.sub (text,1,i)
wait (0.075)
end
if truncateBool then
for rep = 1,3,1 do
object.Text ..= "."
wait(.2)
end
end
end
typewrite (dialogue,"Oh no where's my cute lil' birdie?",true)
wait(0.2)
typewrite (dialogue,"Oh hello there!",false) wait(0.1) typewrite(dialogue,"Can you help me find my lil' bird?",false) wait(0.2) typewrite(dialogue,"I'll give you this star I've got here to you in return.",false)
This will slowly truncate the text if you specify the boolean to do so.
local function typewrite (object , text )
for i = 1,#text,1 do
object.Text = string.sub (text,1,i)
if string.sub(text, i, i + 2) == '...' then
wait(.14) -- replace .14 with the speed you want for "..."
else
wait(.075)
end
end
end
I’m on mobile at the moment so I’m pretty sure this won’t work.
so what i actually want to do is to make the line stop for a while and then a sentence appear next to the previous one instead of starting a new ‘dialogue page’
Edit:Tell me if ur confused cuz I know I’m bad at explaining
local dialogue = script.Parent
dialogue.Text = ""
local function typewrite (object , text, truncateBool)
for i = 1,#text,1 do
object.Text ..= string.sub (text,1,i)
wait (0.075)
end
if truncateBool then
for rep = 1,3,1 do
object.Text ..= "."
wait(.2)
end
end
end
typewrite (dialogue,"Oh no where's my cute lil' birdie?",true)
wait(0.2)
typewrite (dialogue,"Oh hello there!",false) wait(0.1) typewrite(dialogue,"Can you help me find my lil' bird?",false) wait(0.2) typewrite(dialogue,"I'll give you this star I've got here to you in return.",false)