MaxVisibleGraphemes Help

Ello so I have been experimenting with MaxVisibleGraphemes for a project of mine. Anyways, a while ago I tested it with a simple text label with roblox’s example code,

local TweenService = game:GetService("TweenService")
 
local textObject = script.Parent
 
local tweenInfo = TweenInfo.new(
	4, -- it takes 4 seconds for the effect to complete
	Enum.EasingStyle.Sine, -- typing starts fast and slows near the end
	Enum.EasingDirection.Out
)
 
local tween = TweenService:Create(
	textObject,
	tweenInfo,
	{
		-- Final value should be the total grapheme count
		MaxVisibleGraphemes = utf8.len(textLabel.ContentText)
	}
)
 
tween:Play()
tween.Completed:Wait()
 
-- Reset the value so it can be tweened again
textObject.MaxVisibleGraphemes = -1

It worked I was happy, anyways now I am moving to have it typewrite a specific text if your in a specific group. So I need help with the code I made which is,
do not judge I am new to using this

		local TweenService = game:GetService("TweenService")

		local textObject = script.CoreUI.OverheadGui.SecondaryTitle.secMsg

		local sec = script.CoreUI.OverheadGui.SecondaryTitle.secMsg

		local tweenInfo = TweenInfo.new(
			3, -- it takes 4 seconds for the effect to complete
			Enum.EasingStyle.Sine, -- typing starts fast and slows near the end
			Enum.EasingDirection.Out
		)

		if player:IsInGroup(rrModule.ErrorBloodline.GroupID) then
			local tween = TweenService:Create(
				textObject,
				tweenInfo,
				{
					-- Final value should be the total grapheme count
					MaxVisibleGraphemes = utf8.len(sec.Text == rrModule.ErrorBloodline.Text)
				}
			)

			tween:Play()
			tween.Completed:Wait()

			-- Reset the value so it can be tweened again
			textObject.MaxVisibleGraphemes = -1


		end

Any help would be great :heart:

You didn’t exactly describe the problem but instead of utf8.len you probably want to use

MaxVisibleGraphemes = utf8.graphemes(sec.Text)

I’m not sure what you were trying to do with the == inside those parentheses so it might look slightly different.

Also are you sure you can even tween this value? It’s an integer so it might not work. Maybe though.

You might also be interested in this article which provides another way to do what you want

Yeah sorry anyways the issue is it would just show the first letter and nothing else.

I’m not sure exactly what that line does, but I’m pretty sure you only pass the text in the parameters because .len gets the length of the text
MaxVisibleGraphemes = utf8.len(sec.Text)
or
MaxVisibleGraphemes = utf8.len(rrModule.ErrorBloodline.Text)