Frame.visible = true not working?

I want to make it so when a proximityprompt is triggered it brings up a gui. I have tried to use frame.visible = true, but that just does not work for some reason. I am writing this on a localscript and the frame is set to active. Here is the code. Everything works fine except for the gui not becoming visible.

InteractPrompt.Triggered:Connect(function()
	Cam.CameraType = Enum.CameraType.Scriptable
	Cam.CFrame = MenuCamPoints.Point1.CFrame
	ScrollFrame.Visible = true

	Controls:Disable()
end)
3 Likes

From where you are running this script? And how you referenced the instance of the frame? And is it parented to the player GUI folder?

I am running this script in starterplayerscripts. The actual GUI is in startergui and I just realized that could possibly be causing the issue. Here is how I referenced the gui:

local ShopGui = game.StarterGui.ShopGui
local ScrollFrame = ShopGui.ScrollingFrame

If this is the issue, where would I put the GUI instead?

There is an issue with the local ShopGui = game.StarterGui.ShopGui line. Here is the thing, once a player joins the game, they have a different folder for GUIs.

You said that you are running this script from SPS(starterplayerscripts) which is helpful
.

All what do you need to do is getting the player locally and get their GUI folder.

local player = game.Players.LocalPlayer -- gets the player 
local ShopGui = player.PlayerGui.ShopGui -- reference to the actual GUI in the player client
local ScrollFrame = ShopGui.ScrollingFrame

There isn’t any issue with where you are putting your GUI in this situation as it isn’t really that dangerous to be open for anyone.

If this fixed your issue then mark it as the solution

3 Likes