i a script soo that when u click a gui it cloens a gui into your playergui but when u change the value of one of the textbuttons and print it it prints the previous value (the first value)
Alright, well from what I can gather, this is what you will need:
A ScreenGui in StarterGui and A ScreenGui in Replicated Storage. There should be a TextButton under the ScreenGui in StarterGui and a TextBox under the ScreenGui in Replicated Storage. There should also be a StringValue under the TextBox (mine is named "Previous")
Local Script under the TextButton
local player = game.Players.LocalPlayer function Clone() local newgui = game.ReplicatedStorage.ScreenGui:Clone() newgui.Parent = player.PlayerGui end script.Parent.Activated:Connect(Clone)
Local Script under the TextBox
function Change() print(script.Parent.Previous.Value) script.Parent.Previous.Value = script.Parent.Text end script.Parent.Changed:Connect(Change)
The first set of code will clone the other Gui to the Player. The second set of code will print the TextBox text anytime it changes. The StringValue is needed in order to Print the String Value given, however due to the nature of the Changed Event, the function will run for every letter and / or number that is put into the the TextBox.
I think this is what he wanted to say:
"I made a script which makes that every time you click a GUI it clones a GUI into your PlayerGui
folder, but when you change the value of one of the text buttons and print the value it prints the previous value (the first value)."
I can't see the script, but I can guide you... to grammar hours :)... Just a joke! Delete what you made till now about this and do what I say.
Add a GUI in the StarterGui
folder and put a button in it. From now, go make a script inside the button. The script should check if the button was pressed, and if it is it should get the property, let's take as an example the name! It gets the name and it creates a GUI, and it creates in it an TextLabel
, and it updates the text into the text label as the property. This is the script:
local Button = script.Parent local function OnButtonActivated() local Player = script.Parent.Parent.Parent.Parent local GUI = Instance.new("ScreenGui", Player.PlayerGui) local Label = Instance.new("Label", GUI) Label.Text = tostring(Button.Property) --Change the property! end Button.Activated:Connect(OnButtonActivated)
If this is not what you want, please explain us more.