Gui not going invisible

Levels Gui:
Screenshot 2021-03-18 150053

Inventory Gui:
Screenshot 2021-03-18 150017

Hopefully this can help out

it might help to use a different value i would recommend a IntValue or a Stringvalue but i can’t guarantee it will work

if you use a Intvalue you can just use
1 for true
and
2 for false

if you want to use a string value you can still use true or false but in a different way i just don’t know how a string value works

and after some testing with a bool value it didn’t change in my game either

ok, thank you so much for your help!

Glad to help I hope your game will be big someday but until then just ask if you need something if I don’t know it I know someone that might know the answer to your questions.

Until then good luck

You don’t need a string value, your using the bool values wrong.

Give this a shot, if it doesn’t work then try changing your starterGUI variable to the players UI, getting it as a service is definitely something I have never seen before.

local starterGUI = game:GetService("StarterGui")
local inventoryOpen = starterGUI.Inventory.InventoryOpened

inventoryOpen.Changed:Connect(function()
	local currencyExterior = script.Parent.CurrencyExterior
	local currencyInterior = currencyExterior.CurrencyInterior
	local currencyText = currencyInterior.TextLabel
	local levelExterior = script.Parent.LevelExterior
	local levelExterior2 = levelExterior.LevelExterior
	local levelInterior = script.Parent.LevelInterior
	local bar = levelInterior.Bar
	local barShadow = levelInterior.BarShadow
	local levelInterior2 = levelInterior.LevelInterior
	local exp = levelInterior.EXP
	local levelLabel = levelInterior.Label

	if inventoryOpen.Value == true then
		currencyExterior.Visible = false
		currencyInterior.Visible = false
		currencyText.Visible = false
		levelExterior.Visible = false
		levelExterior2.Visible = false
		levelInterior.Visible = false
		levelInterior2.Visible = false
		bar.Visible = false
		barShadow.Visible = false
		exp.Visible = false
		levelLabel.Visible = false
	else
		if inventoryOpen.Value == false then 
			currencyExterior.Visible = true
			currencyInterior.Visible = true
			currencyText.Visible = true
			levelExterior.Visible = true
			levelExterior2.Visible = true
			levelInterior.Visible = true
			levelInterior2.Visible = true
			bar.Visible = true
			barShadow.Visible = true
			exp.Visible = true
			levelLabel.Visible = true
		end
	end
end)

Your issue was that you were reading the inventory opened physcial object, not that objects value.

2 Likes

if its inside local script try this instead

local player = game.Players.LocalPlayer
local starterGUI = player:WaitForChild("PlayerGui")

because player has PlayerGui not StarterGui.

I see @VoidException mentioned it here above me.

2 Likes

^ Exactly what was meant by changing it’s starter gui. If you add this ontop of the code I just send, just remove your get service and replace it with caviars variables, it should work. Credits to cav, thanks for that.

Here are your new variables (for the top of your code):

local player = game.Players.LocalPlayer
local starterGUI = player:WaitForChild("PlayerGui").Inventory.InventoryOpened
1 Like

Yeah can you convert the wmv file to a MP4. I’m a bit skeptical on downloading them now cause someone had a virus in one that I downloaded earlier. (also on the dev forums)

Edit - I did purposely put this on Gui not going invisible.
Its better for people if you use the MP4 format as it does embed and we wont have to download a file that we’ll only use once to see your issue. I’d suggest seeking better alternatives such as Gyazo or some other program that allows you to record. OBS and Streamlabs OBS works as well.

so I changed the StarterGUI into the PlayerGUI and it gave me this in the output.
Screenshot 2021-03-19 141243

You need to also wait for the inventory gui to be added

local Inventory = starterGUI:WaitForChild("Inventory")

Also I’d recommend renaming the starterGUI variable to playerGUI to make more sense

1 Like

It finally works thank you all so much for the help! how can I ever repay y’all?
@VoidException @caviarbro @TheRealGameDev @SlinkyShelf0 @GoteeSign @Pokemoncraft5290

1 Like

No repayment is honestly needed, #help-and-feedback:scripting-support is a forum where anyone can help others without having to repay, it’s all in the goodness of our hearts.

If you have anymore issues don’t be afraid to make another post!

2 Likes

No need! We all do this for fun, glad we could help. If you need anything else just make another topic, that’s what the devforum is here for!

Stay safe!

1 Like

Hey! I’m glad you managed to find a answer!

Remember to make the solution, so if other people have the same issue and stumble across this, they will know what you did to fix it!

Have a good day, stay safe!

1 Like