How can you make to do things when you click first time ,second time , third time or more
Here is the Code: This is a local script on the textbutton
I want it to do something different whenever I want to click the Button 1st time,2nd time,3rd time. but it won't work.
local Frame = game.StarterGui.ScreenGui.Frame
script.Parent.Text = "Open Gui?"
script.Parent.MouseButton1Click:connect(function()
if Frame.Visible == false then
Frame.Visible = true
script.Parent.Text = "Close Gui?"
elseif Frame.Visible == true then
Frame.Visible = false
script.Parent.Text = "Open Gui?"
elseif script.Parent.Text == "Close Gui?" then
script.Parent.Text = "3'rd time clicked"
end
end)

1 comment
the "connect" is supposed to be "Connect"