so i was trying to do it but it doesnt work here is the script...
local Script = game.PlayerGui.ScreenGui1.ImageLabel.TextLabel.Script Script.Parent.Text = game.Players.LocalPlayer.Backpack.Stats.Money.Value end)
can someone help me?
Right,
I have set up two variables
to define the location of both the TextLabel, and the Points.
local Label = game.Players.LocalPlayer.PlayerGui.ScreenGui.ImageLabel.TextLabel local Money = game.Players.LocalPlayer.Backpack.Stats.Money
I am connecting to the event, .Changed
, the function will run once theIntValue
has changed.
Money.Changed:Connect(function()
Now because theIntValue
was .Changed
, the Label will update itself to whatever the Money.Value is equal to.
Label.Text = '$'..tostring(Money.Value) end)
Full code;
local Label = game.Players.LocalPlayer.PlayerGui.ScreenGui.ImageLabel.TextLabel local Money = game.Players.LocalPlayer.Backpack.Stats.Money Money.Changed:Connect(function() Label.Text = '$'..tostring(Money.Value) end)
This code should be in a localscript.
Also, It has been pointed out to me that instead of :connect
, you should be using :Connect
as it has since been deprecated. The same thing with the signal events, disconnect
and wait
.
Hope this helps! Don't forget to accept my answer if this works for you, or leave a comment if you need further assistance!