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 Panel" and when they player is done with the "Loot Panel" they can press the X button to hide the panel, however once the panel is hidden, the ClickDetector no longer makes the "Loot Panel" visible, what's the cause of this?
Code for the X button
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Visible = false
end)

4 comments
Does the X button make the panel invisible or disable the GUI?
Makes it invisible.
It looks like you are setting lootframe to visible, and then when you hit X, it makes lootframe's parent invisible instead of lootframe.
The script is inside the X button, and the X button is inside the LootFrame, therefore the code is correct and it works correctly, LootFrame only has the a Gui itself as it's parent.