i'm making a Gui that pops up when you click on a brick.This is the script
1 | script.Parent.MouseClick:Connect( function () |
2 | game.Players.LocalPlayer.PlayerGui.talk.enabled = true |
3 |
4 | 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,
1 | game.Players.LocalPlayer |
would not work so it should look something like this (not tested):
1 | script.Parent.MouseClick:Connect( function (plr) |
2 | plr:FindFirstChild( "PlayerGui" ).talk.Enabled = true |
3 | end ) |