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

Why doesn't the text change?

Asked by
Oficcer_F 207 Moderation Voter
6 years ago

I am using a local script. It is a TextLabel inside a ScreenGUI.

player = game.Players.LocalPlayer
script.Parent.TextLabel.Text = (player.Backpack.Time.Value)

Why doesn't it change with the players time?

0
Why are you using ( )'s when defining? And also you need to use a loop with wait() in it. AswormeDorijan111 531 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

You only made it change once when the game starts. Use the changed event to make it change whenever the time changes:

player = game.Players.LocalPlayer
player.Backpack.Time.Value.Changed:Connect(function()
    script.Parent.TextLabel.Text = (player.Backpack.Time.Value)
end)
0
I think it would be better like this: script.Parent.TextLabel.Text = "("..player.Backpack.Time.Value")" mixgingengerina10 223 — 6y
Ad

Answer this question