Why my simple close gui script not work

Back
unfriended
Join Date:
Posts:
Dec 2021
10
6 months ago | 22 • 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
6 months 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
6 months 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
6 months 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
Join Date:
Posts:
Streak:
Sep 2019
914
9 days
6 months ago • By Index 9d

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!