i'm making a Gui that pops up when you click on a brick.This is the script
script.Parent.MouseClick:Connect(function() game.Players.LocalPlayer.PlayerGui.talk.enabled = true end)
To make a script do something when a part is clicked, you need a ClickDetector. Also, you would make the gui invisible, then set it to visible (don't use ".Enabled" to make it appear).
Why you got the error you got: Scripts aren't the same as local scripts; you can only use "game.Players.LocalPlayer" on a local script.
if that brick is in workspace,
game.Players.LocalPlayer
would not work so it should look something like this (not tested):
script.Parent.MouseClick:Connect(function(plr) plr:FindFirstChild("PlayerGui").talk.Enabled = true end)