"LocalPlayer" can only be accessed from LocalScripts. Switching the script to a LocalScript won't work, if this script is a decendent of workspace.
mouseClick is not a property of ClickDetector. Remember, everything in scripting is case sensitive. Use MouseClick
There's an unnecessary end in line 6
:connect is deprecated. It's highly recommended you use :Connect.
Now, we have to solve a problem on how to get the player who clicked. MouseClick is an event that, when fired, will send a parameter that will contain the player who clicked.
script.Parent.ClickDetector.MouseClick:Connect(function(PlayerWhoClicked)
local Shop = game.ServerStorage.Shop:Clone()
Shop.Parent = PlayerWhoClicked.PlayerGui
end)
PRO TIP: Output will help you find errors in your code. Leave it open.
1 comment
There is actually a function called mouseClick that shows up when typing it out, but it's not in the API. He probably used that pop up.