Why my simple close gui script not work

Back
unfriended
Join Date:
Posts:
Dec 2021
10
17 days ago | 20 • By unfriended

am i doing something work i dont think so this is the script


script.Parent.Clicked:Connect(function()
script.Parent.Parent.Visible = false
end)


the hierarchy basically looks like this
gui
uibutton
localscript (inside the script is the script above)



unfriended OP
Join Date:
Posts:
Dec 2021
10
17 days ago • By unfriended OP

local script is inside of ui button and ui button is inside of gui



unfriended OP
Join Date:
Posts:
Dec 2021
10
17 days ago • By unfriended OP

also is there a way to not open note pad and open vs code for the script editor



Cra
Join Date:
Posts:
Apr 2024
1
15 days ago • By Cra

I haven't really tried the polytoria editor but I have tried roblox's editor and I'm pretty sure that over there visible isn't a property of a gui so, you might want to remove the second .Parent in your script


Index Plus Deluxe
Join Date:
Posts:
Sep 2019
716
12 days ago • By Index

There was an issue with doing .Visible on GUI objects - it's supposed to be a property but it seemingly breaks in scripts. Try setting a UIView's visible to false instead.



hey, i'm Index! :)