Why does this gui not open from the starterplayerscripts

  1. What do you want to achieve? I want to make a GUI open when I click the q button

  2. What is the issue? It plays the script and it prints but does not open the gui

local uis = game:GetService("UserInputService")
local canOpen = true -- makes a delay so that the user cant keep pressing it over and over again

uis.InputBegan:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.Q and canOpen == true then -- checks if the user is pressing q or not
		canOpen = false
		script.PaperFlip:Play() -- plays the sound of the paper moving
		-- open journal
		game.StarterGui:WaitForChild("Journal"):WaitForChild("BackgroundFrame").Visible = not game.StarterGui:WaitForChild("Journal"):WaitForChild("BackgroundFrame").Visible
		wait(1.3)
		canOpen = true
	end
end)

You are referencing to StarterGui. Instead, try Player.PlayerGui.

1 Like

You should not access GUIs through StarterGui, instead use Player.PlayerGui.

1 Like

You are attempting to change the gui’s properties in StarterGui. To see the effects, you’ll need to change the properties in Player.PlayerGui

1 Like