The code
script.Parent.Head.ClickDetector.MouseClick:connect(function()
player = game.Players.LocalPlayer.PlayerGui
Sgui = Instance.new("ScreenGui", player)
end)
will not work, and neither will
script.Parent.Head.ClickDetector.MouseClick:connect(function()
player = game.Players.LocalPlayer.PlayerGui
Sgui = Instance.new("ScreenGui")
Sgui.Parent = player
end)
All I want it to do is create a ScreenGui inside the player's PlayerGui. What's wrong?

2 comments
I've never heard of the clicked parameter. How did you know about it?
But it still doesn't work.