GUI opening script in tool not working

I have a script inside of a tool that makes a frame in a GUI visible when activated.

But when I activate, nothing happens.

There is no error in the output.

Script:

local Tool = script.Parent
function Activated()
Plyr.PlayerGui.GUI.Frame.Visible = true
	end
function Equip()
	local Char = Tool.Parent
	Plyr = game.Players:GetPlayerFromCharacter(Char)
	print(Plyr)
end
Tool.Activated:Connect(Activated)
Tool.Equipped:Connect(Equip)

How do I fix this?

Is it the frame visibility not working or the activated event?

From what you provided I can only guess. Is the GUI Enabled?

The frame visibility is not working.

The GUI is enabled in the player GUI.

So when you put a print inside the Activated is does print, right?

Is the frame hidden behind anything?
Is the transparency set to 0?

When I put a print message, it printed.

The frame is not hidden behind anything.

The transparency is set to 0.

try to use a bindable event so the gui visible handler is in starter gui

I used a RemoteEvent instead, and it works now.

oh i thinked that u were using a local script