So basically I was doing a shop that would pop up when the player would click a dummy in workspace. So I used a ClickDetector and made a ShopGui which I inserted in the dummy.
The Script in the dummy looks like this:
local clickDetector = script.Parent.ClickDetector
local gui = script.Parent.ShopGui
clickDetector.MouseClick:Connect(function(player)
if not player.PlayerGui:FindFirstChild("ShopGui") then
print("Cloning...")
local clone = gui:Clone()
clone.LocalScript.Disabled = false
clone.Parent = player.PlayerGui
else
print("lolwut")
end
end)
The LocalScript in the GUI looks like this:
local gui = script.Parent.Frame
local buy = gui.Buy
local sell = gui.Sell
local exit = gui.Exit
exit.MouseButton1Click:Connect(function()
script.Parent:Destroy()
end)
After the first time clicking the dummy the ShopGui appears in the player's PlayerGui and prints "Cloning...". Then it always prints "lolwut" no matter if the ShopGui is there or not. I'm stuck.

2 comments
In your else statement you could always disable and renable the gui and the script to bypass this issue. This shouldn't cause any errors because it won't run unless the gui is in the player
The server cannot access existing members of PlayerGui. It can only add new ones. This means that line 5 of the server script will never work properly.