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

Why does my script fail to show a value change and then change text to that value?

Asked by 5 years ago

So when the button is clicked it changes 3 booleans, Based on which button is pressed.


script.Parent.MouseButton1Click:Connect(function() game.StarterGui.MainMenu.OutfitPriceFrame.totalPrice.calculation01.Value = false game.StarterGui.MainMenu.OutfitPriceFrame.totalPrice.calculation02.Value = false game.StarterGui.MainMenu.OutfitPriceFrame.totalPrice.calculation03.Value = true wait(0.4) game.StarterGui.MainMenu.OutfitPriceFrame.totalPrice.totalcalculationlegs.Value = 140 wait(0.4) print("Reached Here") wait(0.5) print(game.StarterGui.MainMenu.OutfitPriceFrame.totalPrice.calculation01.Value) print(game.StarterGui.MainMenu.OutfitPriceFrame.totalPrice.calculation02.Value) print(game.StarterGui.MainMenu.OutfitPriceFrame.totalPrice.calculation03.Value) print(game.StarterGui.MainMenu.OutfitPriceFrame.totalPrice.totalcalculationlegs.Value) end)

This changes the booleans successfully but the value refuses to show change? It changes in the starterGUI.

When the value of totalcalculationlegs is changed it carries out this script.


game.StarterGui.MainMenu.OutfitPriceFrame.totalPrice.totalcalculationlegs.Changed:Connect(function() print(script.Parent.totalcalculationlegs.Value) wait(3) script.Parent.Parent.totalPrice.Text = script.Parent.totalcalculationlegs.Value print("Reached Here") wait(3) print(script.Parent.totalcalculationlegs.Value) end)

This fails to print the value of the current script.

The Value of intValue in StarterGUI remains at 140 though? and fails to change the text.

Here is the print out



0 - Initialtotalcalculationlegs.Value Reached Here - Confirmed Value Change false - Other Boolean False false - Other Boolean False true - Boolean i want true 140 - New Initialtotalcalculationlegs.Value Reached Here - Other Script has reached text changed. 0 -Returned value of Initialtotalcalculationlegs

Any help is appreciated.

1 answer

Log in to vote
0
Answered by 5 years ago

If the GUI is not visible, change the pathway to:

script.Parent.MouseButton1Click:Connect(function()
game.StarterGui.MainMenu.Parent = --player who clicked
end()
0
You are targeting the startergui, but the gui is actually in the PlayerGui EliteRayGawnX2 124 — 5y
Ad

Answer this question