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!

9 comments

1

Any error in the Console?

1

Were the gui’s created locally or on the server?

0

The GUIs are in StarterGui.. And its a local script, and I got no errors in the output..

1

Are you trying to toggle the visibility of the GUI or just put it visible every time the button is clicked?

1

did you try if not playerGui then

1

did you try if not player.playerGui then player:WaitForChild("PlayerGui") skip a line playerGui = player.PlayerGui.ScreenGui

0

I just want the GUI to become visible when I click the button.

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

0

Hey, it worked, I actually had 2 scripts doing the same thing, and it kinda messed it up! But now it works!