How Do I Re Enable A Gui In Script After Disabling It Beforehand?

I Am Having trouble in my script in which i disable a GUI at the beginning and it works as intended but when i try to re enable it later. It will enable itself but wont show up in game

This is what i originally did

 game.StarterGui.VotingGui.Enabled = false

and then later in the script

game.StarterGui.VotingGui.Enabled = true

This is What I have in the GuiScreenShot of GUI

If i am doing this wrong please tell me what i need to do in order to fix it

4 Likes

Are you sure that the GUI actually enables?

when game start, you need to do player.PlayerGui, NOT game.StarterGui

2 Likes

You should be using PlayerGui instead!

Put this into a local script:

local Player = game.Players.LocalPlayer
local PlayerGui = Player.PlayerGui

PlayerGui.VotingGui.Enabled = false

-- Put your code here

PlayerGui.VotingGui.Enabled = true

If this works, make sure to mark it as a solution!

20 Likes

please fix this, there is no such thing as “game.PlayerGui”

Oops, it’s fixed now!

[30 characters]

2 Likes

this should work

1 Like

Lol, he marked your post as the solution :joy:

2 Likes

omg LOL, thats funny, im sorry bro, i didnt mean to steal ur solution from you. :frowning:

2 Likes

Fixed It sorry…didnt mean to mark his post as solution :laughing:

2 Likes