Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

text button changes text label.text?

Asked by 8 years ago

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.

1 answer

Log in to vote
0
Answered by 8 years ago

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.

0
still does not work. lordofpoo 22 — 8y
0
Was there an error? If so, what was the error message? It would be in the output menu. You can turn on the output menu in the view tab :P  User#11440 120 — 8y
Ad

Answer this question