GUI Not Appearing

Hello! I am having a problem which seems pretty trivial. Essentially I want it so that when I equip a tool a GUI appears. However this will not work. I have read the documentation, and watched lots of youtube. Here is the code

local tool = script.Parent
local plr = game.Players.LocalPlayer

tool.Equipped:Connect(function()
plr.PlayerGui.test.Frame.Visible = not plr.PlayerGui.test.Frame.Visible
end)

tool.Unequipped:Connect(function()
plr.PlayerGui.test.Frame.Visible = not plr.PlayerGui.test.Frame.Visible
end)

Any help is appreciated!

What type of Script is this and where is it located? A picture of the explorer would help.

It is a local script which is a child of the tool

Could you show me a picture of the PlayerGui explorer?

It currently just is a test ScreenGUI with a frame as the child

You’re indexing the GUI wrong then. Your code doesn’t match up with your description.

1 Like

What exactly do you mean? I reference the ScreenGUI and then I set the frame to visible

1 Like

Should I move to the StarterGUI instead?

You’re saying in your PlayerGui, that there are two things, a ScreenGui and a Frame.

Your code currently goes to the PlayerGui, then a ScreenGui, and then a random “test” object. It would really help if you could just send a picture of your explorer because I believe you aren’t explaining it correctly.

image

Could you show more of the image?

There is nothing else to show. That is the only part of the GUI.

image
This is the tool

Are there any errors?

Can you send a file of the model/place, so we can easily find the problem?

No there are no errors being printed into the output

The only code being used is the one I listed in my initial post. This shouldn’t be necessary.

I just ran A test… it wont even print anything (The local script)

So, basically the LocalScript just doesn’t do anything at all? If that’s the case make sure Enabled is toggled on

Where is the tool located?