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 » Scripters
Home Search
 

Re: textbox

Previous Thread :: Next Thread 
WeirdGuyHere is not online. WeirdGuyHere
Joined: 20 Oct 2012
Total Posts: 1349
30 Apr 2016 07:10 AM
I have a empty textbox GUI.
If I typed the word "COLOR" inside it and pressed enter, something will happen.
how do I make it that if I clicked enter, something will happen?

this is more like a pass word.
I must write it then click enter.
Report Abuse
Erediin is not online. Erediin
Joined: 13 Mar 2016
Total Posts: 756
30 Apr 2016 07:42 AM


i'm a bit special but I believe it'd be something like:


if game.StarterGui.UI.Frame.Textbox.Text = ("COLOR") then

(code)

end





I'm a beginner though so I'm not too sure.


Report Abuse
WeirdGuyHere is not online. WeirdGuyHere
Joined: 20 Oct 2012
Total Posts: 1349
30 Apr 2016 08:44 AM
that's what I don't want.


I don't want it that while I finish typing color it automatically runs the other script.
I want to write 'color' then CLICK enter.

Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
30 Apr 2016 08:53 AM
first of all don't do 'game.startergui', just make a localscript inside of a frame with a textbox and textbutton with a mousebutton1click event hooked up to the button to check the text of the textbox


Report Abuse
WeirdGuyHere is not online. WeirdGuyHere
Joined: 20 Oct 2012
Total Posts: 1349
30 Apr 2016 09:05 AM
i don't want a button that says
if textbox.text = color then bla bla bla

I want the textbox alone if I write the keyword and click enter.
Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
30 Apr 2016 09:05 AM
Pressing enter usually makes you lose focus of the text box so you could try running the function every time is lost on the text box, then combine that with an if statement checking what the text in the text box is.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
30 Apr 2016 09:06 AM
You need a MouseButton1Click event for a TextButtin if you want anything to happen when you click something


Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
30 Apr 2016 09:06 AM
And if you meant "press enter" instead of "click enter" then shame on you for not being clear. Use the FocusLost event of a TextButton


Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
30 Apr 2016 09:07 AM
Now I'm confuzzled lol
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
30 Apr 2016 09:08 AM
was directed at OP not you ^


Report Abuse
Erediin is not online. Erediin
Joined: 13 Mar 2016
Total Posts: 756
30 Apr 2016 09:16 AM
I was just doing that as an example Recurring, I wasn't really thinking anything through.


Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
30 Apr 2016 09:22 AM
its ok just wanted to let you know never reference game.StarterGui when scripting GUIs if you didn't know it already...more info here:

https://www.youtube.com/watch?v=txcHH11-3v8


Report Abuse
WeirdGuyHere is not online. WeirdGuyHere
Joined: 20 Oct 2012
Total Posts: 1349
30 Apr 2016 09:44 AM
here's an example of a script.


if script.Parent.TextBox1.Text = "color" then
script.Parent.TextButton1.Visible = true


in this script, if I type the word color it will immediately show me the textbutton.
what I want is that when I type the word color nothing happens, I need to press the "ENTER" key for the textbutton to be visible.
Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
30 Apr 2016 09:48 AM
script.Parent.TextBox1.FocusLost:connect(function(enter)
if enter and script.Parent.TextBox1.Text = "color" then --Turns out FocusLost even has an argument for the Enter Key.
end
end)
Report Abuse
Crimsonal is not online. Crimsonal
Joined: 23 Apr 2011
Total Posts: 1795
30 Apr 2016 09:54 AM
script.Parent.TextBox1.FocusLost:connect(function(enter)
if enter and script.Parent.TextBox1.Text:lower() == "color" then

-- do stuff

end

end)
Report Abuse
WeirdGuyHere is not online. WeirdGuyHere
Joined: 20 Oct 2012
Total Posts: 1349
30 Apr 2016 10:20 AM
script.Parent.TextBox1.FocusLost:connect(function(enter)
if enter and script.Parent.TextBox1.Text:lower() == "color" then
TextButton.Visible = true

end

end)


didn't work?
Report Abuse
WeirdGuyHere is not online. WeirdGuyHere
Joined: 20 Oct 2012
Total Posts: 1349
30 Apr 2016 10:21 AM
script.Parent.TextBox1.FocusLost:connect(function(enter)
if enter and script.Parent.TextBox1.Text:lower() == "color" then
script.ParentTextButton.Visible = true

end

end)

-sorry forgot to add script.Parent

but it still doesn't work.
Report Abuse
BikerBoyWes is not online. BikerBoyWes
Joined: 12 Apr 2016
Total Posts: 12
30 Apr 2016 10:22 AM
You forgot to add a dot, right?

script.Parent.TextButton.Visible = true
Report Abuse
WeirdGuyHere is not online. WeirdGuyHere
Joined: 20 Oct 2012
Total Posts: 1349
30 Apr 2016 10:23 AM
also, @extreme your script does not work, there is a red line under the '=' between .text = "color"
Report Abuse
WeirdGuyHere is not online. WeirdGuyHere
Joined: 20 Oct 2012
Total Posts: 1349
30 Apr 2016 10:26 AM
I didn't forgot to add a dot, I just typed it wrong in the thread.
Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
30 Apr 2016 10:27 AM
Mb, forgot an =

script.Parent.TextBox1.FocusLost:connect(function(enter)
if enter and script.Parent.TextBox1.Text == "color" then --Turns out FocusLost even has an argument for the Enter Key.
end
end)

Should work now c:
Report Abuse
WeirdGuyHere is not online. WeirdGuyHere
Joined: 20 Oct 2012
Total Posts: 1349
30 Apr 2016 02:08 PM
still didn't work rip
Report Abuse
Crimsonal is not online. Crimsonal
Joined: 23 Apr 2011
Total Posts: 1795
30 Apr 2016 02:11 PM
you're doing something wrong because I just tested it and it worked fine. It's something on your part
Report Abuse
WeirdGuyHere is not online. WeirdGuyHere
Joined: 20 Oct 2012
Total Posts: 1349
30 Apr 2016 02:38 PM
oh, it actually works.
I forgot to change TextBox1 in the script to the actual name of the textbox.

thanks!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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