Ok, I made a GUI to hold the stats of players
I placed it in starter GUIs for now until I figure out were to place it.
I created several different frames to hold other frames.
but we will start with just the one.....
Ok, the main frame is called Stats, it is placed in PlayerStats, inside StarterGui
under Stats I have 5 other frames
One of the frames is called Cash
under cash I have 3 separate frames, one to hold the name of the main cash frame, one to hold gold stats and one to hold silver stats.
inside the frame for silver I have a frame called storage, and a textlabel to show the name.
inside storage I have a Object (NumberValue) to hold the total amount of silver owned.
my program is designed to take that total value and make the textlabel under storage display the same thing so the player can see how much silver they have.
I have tried many different things and nothing is working. I have tried to change the numbervalue to (string to int) everything.
I have tried to place the code in many different locations. nothing is working
can someone have a look at the code and explain why it isn't taking the value and changing the text on the textlable to the value?
it is simple code and should work but it is not....
here is an example of the folders in my studio
StarterGUI PlayerStats (this is the GUi) Stats (this frame holds everything in the GUI) Cash (this frame holds all the cash values) Frame Gold Silver Storage TotalCash (this frame holds the total silver the player owns) TextLabel (this label is meant to display the total amount TextLabel (this label displays silver) Playerstats Class (this frame holds the players class value) Experience (this frame holds the players experience) Infamy/Level (this frame holds the infamy and level information about the player) Kills/Deaths (this frame holds all information on the players kills and deaths) PlayerStats (this is the button to open and close the Gui) StarterPlayer
local Button = script.Parent Frame = script.Parent.Parent.Stats Convert = script.Parent.Parent.Stats.Class.Class_Text.Storage function onClick() if Frame.Visible == true then Convert.TextLabel = Convert.Container.Value end end Button.MouseButton1Click: connect (onClick)
On line 11
your not doing anything with TextLabel
If you want to change the text of that textlabel make it
Convert.TextLabel.Text = Convert.Container.Value
Hopefully this helped, full code:
local Button = script.Parent Frame = script.Parent.Parent.Stats Convert = script.Parent.Parent.Stats.Class.Class_Text.Storage function onClick() if Frame.Visible == true then Convert.TextLabel.Text = Convert.Container.Value end end Button.MouseButton1Click:connect(onClick)
References: TextLabel Text Property
If this helped please go ahead and accept this answer.
FIXED CODE WITH AUTO UPDATE
local Button = script.Parent frame = script.Parent.Parent.Stats Convert = script.Parent.Parent.Stats.Class.Class_Text.Storage while true do wait(1) containervalue = Convert.Container.Value wait(1) end function onClick() if frame.Visible == true then Convert.TextLabel.Text = containervalue end end Button.MouseButton1Down:connect(onClick)
Hopefully that worked