function onClick()--function script.Parent.CloseButton:Destroy()--destroys text button wait(.5) Instance.new('TextButton',game.StarterGui.TestGui.Frame) --makes new button TextButton.Name = "Taco" --renames it end script.Parent.CloseButton.Clicked:connect(onClick) --I tried using MouseButton1Down
Could i use the "MouseButton1Click"? (my first gui things)
Well, I'm guessing you want the Text to say Tacos, not the name. Also, if you destroy the button the script is in, the script stops and goes with it.
tb = script.Parent -- The TextButton on = false tb.MouseButton1Click:connect(function() if on == false then tb.Text = "Tacos" on = true else tb.Text = "Not Tacos" on = false end end)