Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make textlabel update text?

im making a simulator game and i want a textlabel to display IntValue's value it does actually display it but when it changes the value doesnt update i really need help and sorry if i made a dumb mistake im really new to scripting Script:

script.Parent.Text = game.StarterPack.Pizza.FoodCount.Value

1 answer

✓ Accepted answer
local Player = game.Players.LocalPlayer
local Backpack = Player:WaitForChild("Backpack") --tools in StarterPack will be cloned into Player's backpack
local Pizza = Backpack:WaitForChild("Pizza")

Pizza.FoodCount:GetPropertyChangedSignal("Value"):Connect(function() --this will run everytimes the value is changed
	script.Parent.Text = Pizza.FoodCount.Value
end)

The script must be LocalScript to work with player's GUI.

4 comments

0

thank you so much

0

Wait the text starts of with label but when you click it does actually change how do i fix that

0

@Mantery123 keep it blank before you test the game

0

okeh

This discussion is preserved as it was. New answers, comments, and votes are closed.