I'm trying to make a GUI show up on a player who clicks on the brick, I have a clickdetector and all, and this is in a LocalScript. Code :
local Clicker = script.Parent.ClickDetector local player = game.Players.LocalPlayer Clicker.MouseClick:connect(function(player) game.StarterGui.PurchaseFarmGui.Frame.Visible = true end)
First off, you cant use LocalPlayer due to this most likely being in a regular script, but luckily for us, click detectors recognize the player who clicked it. Secondly, on line five the script is editing the source GUI, not the one that has been replicated to the player. So try this:
local Clicker = script.Parent.ClickDetector Clicker.MouseClick:connect(function(player) player.PlayerGui.PurchaseFarmGui.Frame.Visible = true end)