Dialog not appearing

Hey Everyone,
so I’m making a game like piggy, but my dialog isn’t appearing!

local Message = game.ReplicatedStorage.Values:WaitForChild('Message')
local TextLabel = script.Parent.Message

Message:GetPropertyChangedSignal('Value'):Connect(function()
	print('New!')
	if Message.Value == 'None' then
		script.Parent.Message.Visible = false
	else
		script.Parent.Message.Visible = true
		for i = 1,#Message.Value,1 do
			TextLabel.Text = string.sub(#Message.Value,i,1)
			wait(.04)
		end
	end
end)

New prints, but the text label doesn’t become visible. I checked and the text is not none.
Does anybody know why it’s not working?
Thanks!

Did you check the output there might be a some errors there that can help

There are no errors…

local TextLabel = textlabel
TextLabel.Visible = true

Are you certain Message.Value isn’t always ‘None’? (Debug this by printing it).

FYI: This typewriting effect logic isn’t correct:

It’ll only show one character at a time, you can resolve this by setting start to 1 and end to i:

TextLabel.Text = string.sub(#Message.Value, 1, i);

Also, 1 is the default step in numerical for loops - you can get rid of it!

2 Likes

Seems like that was the problem, after fixing it, the dialog appeared!

1 Like