Why doesn't the Gui open?

I try to do a kick gui but when I try it it does not open everything works but the only thing that does not work is that it does not open

¡any help is appreciated!

scrip:

 local frame = script.Parent.Frame
script.Parent.GuiToggle.MouseButton1Click:connect(function()
	if frame.Visible == true then
		frame.visible = true
	end
end)

frame.Kick.MouseButton1Click:connect(function()
	if game.Players:FindFirstChild(frame.Player.Text) then
		game.ReplicatedStorage.KickPlayer:FireServer(frame.Player.Text, frame.Reason.Text)
	end
end)

Well, you didnt notice this?
Change to:

	if frame.Visible == false then
		frame.Visible = true
	end

its suppsed to be frame.Visible not frame.visible, lua is case-sensitive

script.Parent.GuiToggle.MouseButton1Click:connect(function()
    frame.Visible = not frame.Visible -- This is better because it is short, this means that if the gui is visible it will become invisible and vice versa
end)

Edit: Changed some things

1 Like

now if it opens but does not close

Don’t you know that? just add else

	if frame.Visible == false then
		frame.Visible = true
    else frame.Visible == true then
        frame.Visible = false
	end

Or you can do frame.Visible = not frame.Visible