TypeWriter Text Not Working

Good afternoon!

This script completely stopped working with no errors. Quite confused by this. The script should make text type out like a character talking in story games. Here’s the script:

local textLabel = script.Parent:WaitForChild(“Main”):WaitForChild(“Text”)
game.StarterGui.Scrolling.Enabled = false

wait(10)

game.StarterGui.Scrolling.Enabled = true
local function typewrite(object, text)
for i = 1,#text,1 do
object.Text = string.sub(text,1,i)
wait(0.05)
end
end

typewrite(textLabel,“You’ve been asleep for 10 days, run at the wall in front of you”)

Please help! :wave:

Here’s the model to go with it by the way: Type Writer Text? - Roblox

Maybe check the properties of your UI label. Could be color is the same as the background.

The code looks solid to me.

What properties would you change? I have a link to the model where you can tinker with it. There isn’t any background to my knownledge.

Copying it is not allowed. And now i’m adding text because of the character count requirement. Make it free modeled

Copying’s not allowed? It isn’t copying if I already made the script. Also, I made it a free model so people can use it and help me. There’s a link to the free model in the post.

This item is not currently for sale.

I have lost faith in you goodbye.

Oh, I’ll set it to public. Did not realise it wasn’t public already. Alright, it’s public now.

AlvinBlox has a tutorial on this, you can compare his script to yours to see if you wrote anything wrong.

Alright, let me go rewatch the video.

You must use PlayerGui, as it will be displayed on the player’s screen

local textLabel = script.Parent:WaitForChild("Main"):WaitForChild("Text")
local PlayerGui = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
PlayerGui.Scrolling.Enabled = false

wait(10)

PlayerGui.Scrolling.Enabled = true
local function typewrite(object, text)
	for i = 1,#text,1 do
		object.Text = string.sub(text,1,i)
		wait(0.05)
	end
end

typewrite(textLabel,"You’ve been asleep for 10 days, run at the wall in front of you")

If that doesn’t solve everything, what’s missing?

Is it a local script? That might make it work.

It is a local script. (Charrrrr)

1 Like

Tried it, nothing happened. Here’s where everything is in startergui: Capture

To measure a string use string.len()

local textLabel = script.Parent:WaitForChild("Main"):WaitForChild("Text")
script.Parent.Scrolling.Enabled = false

wait(10)
script.Parent.Scrolling.Enabled = true
local function typewrite(object, text)
	for i = 1, #text do
		object.Text = text:sub(1,i)
		wait(0.05)
	end
end

typewrite(textLabel,"You’ve been asleep for 10 days, run at the wall in front of you")

you forgot to completely write out text label (the objects name) in first line in the waitforchild:

local textLabel = script.Parent:WaitForChild("Main"):WaitForChild("TextLabel")

Next time check the output–simple fix.

2 Likes

I just realized how much time I wasted on a simple fix. That was too easy and I guess I no longer have common sense :smile: Thank you for helping me!

I wouldn’t recommend adding to the string of the text, instead change the MaxVisibleGraphemes property of the textlabel

2 Likes

what is that? API turns out blank for it

https://developer.roblox.com/en-us/api-reference/property/TextLabel/MaxVisibleGraphemes

MaxVisibleGraphemes sets how many characters of the text you can see

1 Like

(post marked for deletion for privacy reasons)