TextLabel Doesn't Show (PLEASE HELP!)

Hello! My text (the new objective text) randomly stopped responding to the script.

typewrite(dialogueLabel, "Try looking for clues, that always works out for us.", 0.05)
					wait(2)
					fadeText()
					Sounds.Objective:Play()
					wait(0.5)
					objectiveLabel.Position = UDim2.new(0.027, 0, 0.023, 0)
					game.StarterGui.ScreenGui.newObjective.Visible = true
					typewrite(objectiveLabel, "New objective; look for clues to escape.")
					

& it still makes the typewriting noise btw it just doesnt move or anything

my typewriting script:

local function typewrite(object,text,length)
	for i = 1,#text,1 do
		local sound = Instance.new("Sound")
		sound.Parent = game.Workspace
		sound.SoundId = "rbxassetid://903267862"
		sound.Name = "DialogSound"
		sound:Play()
		object.Text = string.sub(text,1,i)
		wait(length)
	end
	for i,v in pairs(game.Workspace:GetChildren()) do
		if v.Name == "DialogSound" then
			v:Destroy()
		end
	end
end

It doesn’t do anything. I’m so stumped. thanks

1 Like

Can you show what fadeText() is?

2 Likes

of course here:

local function fadeText()
	game:GetService("TweenService"):Create(dialogueLabel, TweenInfo.new(1), {TextTransparency = 1}):Play()
		game:GetService("TweenService"):Create(dialogueLabel.UIStroke, TweenInfo.new(1), {Transparency = 1}):Play()
	--
		game:GetService("TweenService"):Create(dialogueLabel, TweenInfo.new(1), {TextTransparency = 0}):Play()
	game:GetService("TweenService"):Create(dialogueLabel.UIStroke, TweenInfo.new(1), {Transparency = 0}):Play()
end
1 Like

Does your character die before this is displayed? You might have ResetOnSpawn set to true which will cause it so when you die the dialogueLabel variable doesn’t actually reference the text after the death.

1 Like

Hmm, why do you have a function that has a tween that just undoes itself right after immediately? That could be the problem.

1 Like

im not really sure, im not the best scripter haha

1 Like

no they dont, in fact when you die u get kicked. but thanks for your idea! :smiley:

Another mistake you could be making is that you’re referencing StarterGui instead of the player’s PlayerGui, but I can’t be sure since I can’t see more of the code

Yeah if the rest of the script works except for the text not showing, it’s probably fade text. And you don’t have any waits in between the transparency = 1 and the transparency = 0 parts so it just doesn’t show because both are going at the same time

if you’d like i can show you the whole code?

That explains a lot! thank you! but im still not sure why the text just isnt working.

You are not modifying the actual GUI parts that are present on the screen. You are manipulating the items inside of a Starter container. The real GUI is actually placed under Player within their PlayerGui.

Be aware that the instance inside the StaterGui is only for cloning to the Player.PlayerGui.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.