Gui won't enabled when click on part

I am trying to make a gui pop up when clicked on a part. The script isn’t working. If you know how to fix it, please help me.

Script:

local Click = script.Parent.Click
local ClickDetector = Click.ClickDetector

ClickDetector.MouseClick:Connect(function(PlayerWhoClicked)
	game.Players.player.PlayerGui.Select.Enabled = true
end)
1 Like

You included a parameter but you didn’t use it in the function.

Usually, I’d use server events for these but try doing this:

local Click = script.Parent.Click
local ClickDetector = Click.ClickDetector

ClickDetector.MouseClick:Connect(function(PlayerWhoClicked)
	PlayerWhoClicked.PlayerGui.Select.Enabled = true
end)
2 Likes