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

Simple GUI script doesn't work? [FE] (SOLVED)

Asked by
Oficcer_F 207 Moderation Voter
5 years ago
Edited 5 years ago

So, this script is SO EXTREMELY EASY and I have no idea why it doesn't work, it works in every single other script but not this one. Here it is:

player = game.Players.LocalPlayer

playerGui = player.PlayerGui.ScreenGui

script.Parent.Parent.MouseButton1Click:Connect(function()

    playerGui.RedUpgradeGui.Main.Visible = true
    playerGui.RedUpgradeGui.Main.Active = true

end)

This is a LOCAL SCRIPT Please help!

1
Any error in the Console? RicheeNektar 78 — 5y
1
Were the gui’s created locally or on the server? ABK2017 406 — 5y
0
The GUIs are in StarterGui.. And its a local script, and I got no errors in the output.. Oficcer_F 207 — 5y
1
Are you trying to toggle the visibility of the GUI or just put it visible every time the button is clicked? User#20279 0 — 5y
View all comments (5 more)
1
did you try if not playerGui then HappyTimIsHim 652 — 5y
1
did you try if not player.playerGui then player:WaitForChild("PlayerGui") skip a line playerGui = player.PlayerGui.ScreenGui HappyTimIsHim 652 — 5y
0
I just want the GUI to become visible when I click the button. Oficcer_F 207 — 5y
0
Y'know, sometimes, Players.PlayerGui.Screengui doesn't really work, so you've gotta say something like this "Player:WaitForChild("PlayerGui"), then you can do PlayerGui.ScreenGui Theroofypidgeot 21 — 5y
0
Hey, it worked, I actually had 2 scripts doing the same thing, and it kinda messed it up! But now it works! Oficcer_F 207 — 5y

Answer this question