generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Changed text in textbox- How do you test for it?

Previous Thread :: Next Thread 
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
13 Jul 2014 08:32 PM
I am making a Mainframe where you can enter data, but I don't know how to test for the text a user typed into a textbox. Can someone help? This doesn't work right, apparently. It's a script inside the textbox.

script.Parent.FocusLost:connect(function()
if script.Parent.Text then
end
end)


Caaaactus.
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
13 Jul 2014 08:39 PM
b1

Caaaactus.
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
13 Jul 2014 08:47 PM
b2

Caaaactus.
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
13 Jul 2014 08:51 PM
Your conditional doesn't make any sense. Did you mean if the text wasn't empty?

if script.Parent.Text ~= "" then
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
13 Jul 2014 08:53 PM
No, the text in the textbox is originally set to [PLAYER_NAME_HERE]
The player should be able to type in the box, which works. It changes the text on screen, but it doesn't change the value.

Caaaactus.
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
13 Jul 2014 08:57 PM
Try changing it through that Player's PlayerGui.
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
13 Jul 2014 08:58 PM
uh... what? I can't collect the data, and they won't be entering there own name...

Caaaactus.
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
13 Jul 2014 09:01 PM
What exactly are you trying to use the mainframe for?.
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
13 Jul 2014 09:02 PM
For my group, we'll be saving Points earned at player events to earn promotions.

Caaaactus.
Report Abuse
FertileTurtle is not online. FertileTurtle
Joined: 04 Dec 2012
Total Posts: 1414
13 Jul 2014 09:06 PM
Try doing this

script.Parent.InputChanged:connect(function()
if script.Parent then
print(script.Parent.Text)
end
end)
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
13 Jul 2014 09:09 PM
Doesn't change it, it just spams my output with whatever i typed in. It doesn't change the value, though.

Caaaactus.
Report Abuse
FertileTurtle is not online. FertileTurtle
Joined: 04 Dec 2012
Total Posts: 1414
13 Jul 2014 09:13 PM
I thought that was what you wanted it to do, sorry. Now, I think that you're trying to find if a player's text is equal to some certain text.

script.Parent.InputChanged:connect(function()
if script.Parent.Text = "TheSuperSecretString" then
print("Omg, he found it out")
end
end)
Report Abuse
FertileTurtle is not online. FertileTurtle
Joined: 04 Dec 2012
Total Posts: 1414
13 Jul 2014 09:14 PM
Had an error.

if script.Parent.Text == "TheSuperSecretString" then
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
13 Jul 2014 09:16 PM
I don't know what the input will be! It's not like a passw0-rd to a door! It's creating a datafile!

Caaaactus.
Report Abuse
FertileTurtle is not online. FertileTurtle
Joined: 04 Dec 2012
Total Posts: 1414
13 Jul 2014 09:21 PM
Still a bit confused... What do you mean by creating a datafile? If you mean by putting the text the user typed into a string then I prefer that you use a button to make sure that it doesn't create a bunch of objects.

Put this script inside a textbutton


DataFile = {}

script.Parent.MouseButton1Click:connect(function()
if string.len(script.Parent.Parent.TextBox.Text) >= 1 then
DataFile[#DataFile+1] = script.Parent.Parent.TextBox.Text
for i=1,#DataFile do
print(DataFile[i]
end
end
end)


Try that, I'm not very experienced with Tables.
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
13 Jul 2014 09:23 PM
.... Here, look.
/OLUFPlH,1CgtNWT

Caaaactus.
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
13 Jul 2014 09:24 PM
All the textbox should do is allow you to type a name in, and it should change the TextBox Value's "Text".

Caaaactus.
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
13 Jul 2014 09:26 PM
Then do you want it to check to see if a Player with that Name is in existence?.
Report Abuse
FertileTurtle is not online. FertileTurtle
Joined: 04 Dec 2012
Total Posts: 1414
13 Jul 2014 09:27 PM
Whenever you type inside a TextBox, by default, it will already update the TextBox's text to what you typed in.
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
13 Jul 2014 09:35 PM
It doesn't. watch.
https://www.youtube.com/watch?v=ARJdiXc7MvY&feature=youtu.be

Caaaactus.
Report Abuse
FertileTurtle is not online. FertileTurtle
Joined: 04 Dec 2012
Total Posts: 1414
13 Jul 2014 09:41 PM
...

You went inside the StarterGui, not the player's Gui.
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
13 Jul 2014 09:44 PM
oh my god.

Caaaactus.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image