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

The .Visible Property isn't updating, Is this a bug?

Asked by 4 years ago

Hello, In my script I have it set to when ever you press a button it makes certain things visible and others invisible, the problem is it changed the property in the property tab but not on screen. I can got to the objects visible property and it will be off and it will still be on screen. When I turn it off before I start the game it disappears but not when I use a script. Keep in mind I am new, so I'm sorry if this is a dumb question. Another thing to note is that it was working until I changed the order of the uis in the starter UI and before I made some coding edits.

01--Variables:
02 
03local everything =  game.StarterGui:WaitForChild("ScreenGui"):WaitForChild("Frame")
04local ShopFrame = game:GetService("StarterGui").ScreenGui.ShopFrame
05local shopui = game:GetService("StarterGui").ScreenGui.Frame.ShopGUI
06local buttonframe = game:GetService("StarterGui").ScreenGui.Frame.ShopButton.Frame
07local Start = script.Parent.Parent.Start
08 
09 
10button.MouseButton1Down:Connect(function()
11    print("Help")
12    everything.Visible = false
13    if everything.Visible == false then
14        print("yes")
15        shopui.Visible = true
View all 22 lines...

Thanks!!

0
It prints Help and Yes just fine btw EmeraldRailYT 8 — 4y
0
Any errors? Soban06 410 — 4y
0
Nope EmeraldRailYT 8 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

I think that it doesn't work as it relates to StarterGui and not the player's gui. You should try and change the lines from 3 to 6. If your script is LocalScript, then it would look like this:

1local everything =  game:GetService("Players").LocalPlayer.PlayerGui.ScreenGui:WaitForChild("Frame")
2local ShopFrame = game:GetService("Players").LocalPlayer.PlayerGui.ScreenGui.ShopFrame
3local shopui = game:GetService("Players").LocalPlayer.PlayerGui.ScreenGui.Frame.ShopGUI
4local buttonframe = game:GetService("Players").LocalPlayer.PlayerGui.ScreenGui.Frame.ShopButton.Frame
0
Thanks so much! It works! EmeraldRailYT 8 — 4y
Ad

Answer this question