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

please help me (ignore this : game players.Workspace)?

Asked by 5 years ago

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)

0
Ok, firstly, please clean up your grammar so we can better assist you SerpentineKing 3885 — 5y
0
Also, please watch your reputation, if you fall under a rapid loss you may be suspended! WideSteal321 773 — 5y
0
And, please show code! WideSteal321 773 — 5y
0
..whaat? Ziffixture 6913 — 5y
0
..whaat? WideSteal321 773 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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.

Ad
Log in to vote
0
Answered by
Vik954 48
5 years ago

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.

Answer this question