I am having a issue with a ui overlapping unitl i realised i can use scripts (Issue)

I made the zobucks outside off the games gui parent but it closes the games and dont open zo bucks this is the code i used:

script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Visible = false
script.Parent.Parent.Zocash.Visible = true
end)