How to get the text of a Textbox?

Apologies, if my wording is unclear, I’m still kinda new to this, but basically, what I’m trying to implement is a “code” system, where if the player enters the code from an in-game item, it gives them a small pet, although I am unsure how to get the TextBox contents in the first place to do so.

Any help is appreciated! ^

Let me know if this is belonging to the wrong category, so I can change/delete it, please. ^

You can just do this:

print(TextBox.Text)

-- prints the textbox's text!

Ah, well, I mean, what I’m trying to do is: Set a code requirement, like for example, in the textbox, a player must write “FREEPET” in order to receive the pet, but I’m unsure how to set such requirements.

Is there any code we can review?

This video can help you.

3 Likes

Mhm!

   if TextBox.Text == "FREEPET" then
    pendInv(Receiver, ..  RandomPet)
  end)
end)

thanks! i’ll check that out, just saw this!

Can I see the whole code so that we can see what this function exactly does? This isn’t alot of info here.

Thanks for the help! I’ve marked this as a solution, and you’ve also managed to recommend me a good youtuber for this! Really appreciate the help :smiley:

1 Like

You’re welcome. If you have any question, you can open a new topic and ask again. Have a nice day. :slight_smile: