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

Can someone help me make my Gui put how much money i have?

Asked by 7 years ago

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?

1 answer

Log in to vote
0
Answered by
awfulszn 394 Moderation Voter
7 years ago
Edited 6 years ago

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!

0
thx a lot and one more thing, do I just put this script inside of the text label, and then if so instead of a script i use a localscript right? YoMomma121121 -11 — 7y
0
I put the script inside of textlabel and I made it a localscript instead of just a script, but idk if I just put it in the wrong place because it still wont put how much money the player has on the gui YoMomma121121 -11 — 7y
0
nvm it works thx so much YoMomma121121 -11 — 7y
Ad

Answer this question