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

Why wont clicking the text box change its own text?

Asked by 5 years ago

For whatever reason when I use the following script, the text button I am trying to change the text of will remain the same.

local button = script.Parent.TextButton

if button.MouseButton1Down == true then
    button.Text = "X"
    script.Parent.TextButton2.Visible = true
    print("yep")
end

Any suggestions?

0
Does it do the print? Knineteen19 307 — 5y
0
What Deku said. Also whyd you delete your question? DinozCreates 1070 — 5y
0
Well what you said about where mousePose came from kind of made me realize a simple mistake. I forgot to put the mousePose parameter in the local script xD. I was gonna wait for you to post it as an answer so I could accept it, but after a while I decided to just delete the question. Knineteen19 307 — 5y
0
I don't think it printed MustangHeart 67 — 5y
View all comments (5 more)
0
Ah lol, with no reference i was confused how it worked, that makes sense and glad it helped. DinozCreates 1070 — 5y
0
Well then that tells us the event never occurs. Did you want to make so it changes the text until the mouse stops holding it? Or did you just want it to change with a simple click. Knineteen19 307 — 5y
0
Yeah, thanks lol. Knineteen19 307 — 5y
0
I want to change it with a click MustangHeart 67 — 5y
0
"First off, as you may know, Lua and RLua (Roblox Lua) are different in many ways." User#24403 69 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

Use a function, not a true/false parameter.

local button = script.Parent.TextButton

button.MouseButton1Click:Connect(function()
    button.Text = "X"
    script.Parent.TextButton2.Visible = true
    print("yep")
end)
0
lmao dude totally forgot I had to do that, thanks lol MustangHeart 67 — 5y
0
Lol it happens, brain fart. DinozCreates 1070 — 5y
Ad

Answer this question