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

Adding string to a StringValue from another string?

So I'm making a password Gui to open a door, and I've come across an issue which I'm completely clueless on how to do. The problem is, I'm trying to add text from a TextButton into a StringValue, but I can't figure out how ANYWHERE.

script.Parent["1"].MouseButton1Click:connect(function(click)
	script.Parent.Value.Value=script.Parent.Value.Value+script.Parent["1"].Text
end)

Yes, it works kind of.. All it does is add a NUMBER to the Value, and if I try to change the text to a String, it says that it can't be placed because It's a "StringValue".. Keep in mind that I'm new at this but help would be greatly appreciated.

1 answer

✓ Accepted answer

Well, your thinking was a bit correct, but the way you worded it wasn't good. You have to use concatenation.

script.Parent["1"].MouseButton1Click:connect(function(click)
    script.Parent.Value.Value= script.Parent.Value.Value..script.Parent["1"].Text
end)

2 comments

0

thank you!

0

Glad I could help!

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