Gui visibility toggler not working

This is a script to make a certain GUI visible/not-visible. What is wrong with this code? vis is a BoolValue in StarterGUI of its ScreenGUI. Any help is great! Thanks.

local vis = script.Parent.Parent.vis
vis = false
repeat wait()
	script.Parent.Visible = false
	script.Parent.Parent.Button.Visible = false
until vis == true
if vis == true
then
	script.Parent.Visible = true
	script.Parent.Parent.Button.Visible = true
end

You have to say vis.Value instead of changing the variable for vis.

For example, vis.Value = true

2 Likes