Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Getting to the PlayerGui?

This is what i tryed Ik it sucks

function onclickedofheader() player = workspace:FindFirstChild(player) game.player.PlayerGui.ScreenGui.Frame.Visible = true end

workspace.Header.ClickDetector.MouseClick:connect(onclickedofheader)

How do i get the PlayerGui when they click a part?

1 answer

✓ Accepted answer
local brick = script.Parent
local click = brick:WaitForChild("ClickDetector")

click.MouseClick:connect(function(player_who_clicked)
	local player = game.Players:GetPlayerFromCharacter(player_who_clicked.Character)
	local gui = player.PlayerGui:findFirstChild("ScreenGui")
	if gui then 
		gui.Frame.Visible = true
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.