This is what I tried:
Player = game.Players.LocalPlayer function onClick(playerWhoClicked) Player.PlayerGui.ScreenGui.Enabled = true end script.Parent.ClickDetector.MouseClick:connect(onClick)
How can I make this work? What did I do wrong?
Hello! If you haven't already, try making the GUI object visible.
local Player = game:GetService( 'Players' ).LocalPlayer local function onClick( PlayerWhoClicked ) Player.PlayerGui.ScreenGui.GuiObject.Visible = true end script.Parent.ClickDetector.MouseClick:connect( onClick )
Change GuiObject to the name of the object you wish to make visible.
try changing the script to...
local plr = game.Players.LocalPlayer script.Parent.ClickDetector.MouseClick:Connect(function(onClick) plr.PlayerGui.ScreenGui.FRAMENAME.Visible = true end)
and of course change FRAMENAME to whatever the name of the frame is.