Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is Textlabel.Text not changing?

Asked by 3 years ago
local fluffing = game.Workspace.Sounds["Fluffing A Duck"]
local textSound = game.Workspace.Sounds["OneShot - Text"]
local Dialogue = game.StarterGui.Dialogue.TextLabel

fluffing:Play()

Dialogue.Text = "Dad: Alrighty son, it's time for bed."
wait(4)
textSound.Playing = true
Dialogue.Text = "Dad: No! You cannot watch another episode of Two Piece!"
wait(4)
textSound.Playing = true
Dialogue.Text = "Dad: No son, c'mon go take your medication and go to bed..."
wait(4)
textSound.Playing = true
Dialogue.Text = "Task: Take your medication."

The Textlabel's text wont change on screen as told to in script, everything else works and runs smoothly, anyone know why?

Thanks in advance!

0
This might work but I am not sure because I haven't scripted text labels in a while. Change line 3 to: local Dialogue = game.Players.LocalPlayer.PlayerGui:FindFirstChild("Dialogue"):FindFirstChild("TextLabel") MarcTheRubixQb 153 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

I am going to take a guess and say that you don't have the script in the Dialogue ScreenGui. When experimenting with this, I found that a simple way to change fix the text not changing is by parenting the script to the Dialogue ScreenGui and change line 3 to:

local Dialogue = script.Parent.TextLabel

or something like that.

There may be other methods to fix this, but this was the first one I came up with.

Ad

Answer this question