Gatherable = true
script.Parent.MouseClick:Connect(function(Player)
if Gatherable == true then
Player.PlayerGui.LootPanel.LootFrame.Visible = true
end
end)
This ClickDetector is supposed to open up a "Loot Frame" and when the player is done with the "Loot Frame" they can press the X button to hide the panel, however once the panel is hidden, the ClickDetector no longer makes the "Loot Frame" visible, what's the cause of this?
Code for the X button
script.Parent.MouseButton1Click:Connect(function()
-- This is connected to the LootFrame
script.Parent.Parent.Visible = false
end)

6 comments
So here's a tip: Please show the variables when you defined them to so it would be easier for the readers/debuggers to understand what the variables mean, also, is gatherable meant to be a local or normal variable? You didn't make Gatherable a local variable, which can cause other players to control the Gui. Third, you never declare Gatherable to be false. And Lastly, Line 3 shows MouseButton i...
nstead of using MouseButton1Click. The computer doesnt know what mousebutton is. It can be anything. Always use MouseButton1Click
Hope this helped!
MouseClick is the equal to MouseButton1Click in ClickDetector, I haven't provided the function with a If false because i didn't work on it because the problem is still there, It still doesn't work whether or not it's a Local Variable.
You cannot do this with GUIs. GUIs need to be done locally and therefore you can't open it using a server script., you need to fire a remote event to the GUI telling it to open.
Thank you mate, just what i needed to know.