Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why wont clicking the text box change its own text?

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?

9 comments

0

Does it do the print?

0

What Deku said. Also whyd you delete your question?

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.

0

I don't think it printed

0

Ah lol, with no reference i was confused how it worked, that makes sense and glad it helped.

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.

0

Yeah, thanks lol.

0

I want to change it with a click

0

"First off, as you may know, Lua and RLua (Roblox Lua) are different in many ways."

1 answer

✓ Accepted answer

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)

2 comments

0

lmao dude totally forgot I had to do that, thanks lol

0

Lol it happens, brain fart.

This discussion is preserved as it was. New answers, comments, and votes are closed.