I am making a unique speech GUI at the bottom of the screen for a game and I want a button that says "Continue" to carry on with the speech but it isn't working. What I have right now:
Continue=script.Parent.Continue --script to Screen GUI,Continue(Button)-- text=script.Parent.Speech.Text --script to Screen GUI,Speech(Text label),text-- local Button =Continue while true do wait (1) function onClick() if Continue.Visible==true then Button.MouseButton1Click:connect (onClick) do wait (1) text = "How are you" --not real text wanted just example-- end end end
Please help.
You're calling a function from within the function. You don't need a loop to call a function. Here's what I would recommend changing,
Continue=script.Parent.Continue text=script.Parent.Speech.Text local Button =Continue function onClick() if Continue.Visible==true then wait (1) text = "I'm good. You?" end end Button.MouseButton1Click:connect(onClick)
There may be more wrong with your script but try this and let us know if there's any more errors.