Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Clickdetector shows Gui once, how can i fix this?

Asked by 5 years ago
Edited 5 years ago
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)
0
Does the X button make the panel invisible or disable the GUI? Alexander_Ashford 231 — 5y
0
Makes it invisible. HeroKajusa 0 — 5y
0
It looks like you are setting lootframe to visible, and then when you hit X, it makes lootframe's parent invisible instead of lootframe. WizyTheNinja 834 — 5y
0
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. HeroKajusa 0 — 5y

Answer this question