MouseButton1Click NotWorking

For some reason MouseButton1Click isnt working in my code.Any solutions.Doesnt work in everything I code. It is a Local Script My code is below

local EnterCodeFrame = game.StarterGui.SupportACreator.EnterCodeFrame
local player = game.Players.LocalPlayer
local Button = script.Parent

	EnterCodeFrame.Visible = true

Try MouseButton1Down and define the frame variable differently. I don’t think you can access GUIs like that using StarterGUI. So try using playergui instead. If not use remote events.

local EnterCodeFrame = game.StarterGui.SupportACreator.EnterCodeFrame

StarterGui is a member of the player, not the game.

This should work instead

local EnterCodeFrame = game.Players.LocalPlayer.StarterGui.SupportACreator.EnterCodeFrame

Instead of using
To define the location of a GUI instance, use

didnt work. Any other suggestions?

Learn about how the StarterGui service works, this would work instead.

local EnterCodeFrame = game.Players.LocalPlayer.PlayerGui.SupportACreator.EnterCodeFrame

The problem isn’t coming from MouseButton1Click but from the version of enter code frame that you’re referencing.

1 Like

Are you using playergui or startergui? Use playergui to define the variable as I stated.

StarterGui is a member of the game, PlayerGui is a member of the player which holds all the player’s guis.

startergui how do you switch it to playergui

Use the line of code @C0lvy123 provided

1 Like

thanks man appreciate it! have a good day