Aurarus
|
  |
| Joined: 22 Dec 2008 |
| Total Posts: 4761 |
|
|
| 24 Sep 2011 08:07 AM |
TextBox.Text.Changed:connect(Derp)
So apparently Text can't have a connection line attached to it, because when I run the script (This aint the entire script) it sees "Changed" as a property, and then calls it nil.
How can I tell a script to run when the string changes? |
|
|
| Report Abuse |
|
|
Aurarus
|
  |
| Joined: 22 Dec 2008 |
| Total Posts: 4761 |
|
| |
|
Aurarus
|
  |
| Joined: 22 Dec 2008 |
| Total Posts: 4761 |
|
|
| 24 Sep 2011 08:21 AM |
| Come on people, I really need help here... |
|
|
| Report Abuse |
|
|
Aurarus
|
  |
| Joined: 22 Dec 2008 |
| Total Posts: 4761 |
|
| |
|
|
| 24 Sep 2011 08:34 AM |
TextBox.Changed(function(p) if p=="Text" then
end end)
Something like that? |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 24 Sep 2011 08:37 AM |
Changed is an event. Not a method....
TextBox.Changed:connect(function(Text)
end) |
|
|
| Report Abuse |
|
|
Aurarus
|
  |
| Joined: 22 Dec 2008 |
| Total Posts: 4761 |
|
|
| 24 Sep 2011 08:37 AM |
Text is a child of TextBox. Text is a StringValue, while Textbox is just a GUI object.
Saying TextBox.Changed isn't specifying what is being changed. |
|
|
| Report Abuse |
|
|
Aurarus
|
  |
| Joined: 22 Dec 2008 |
| Total Posts: 4761 |
|
|
| 24 Sep 2011 08:39 AM |
| In the original post, when i said "connection line" I meant "connection event" |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 24 Sep 2011 08:39 AM |
I just specified it. Read through my script. |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 24 Sep 2011 08:39 AM |
It isnt called a connection line of connection event.
connection is a method. It is called a connection STATEMENT. |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2011 08:41 AM |
Oh sorry forgot :connect
Anyway, specify text by checking if the value is text. |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 24 Sep 2011 08:43 AM |
Dude.... LOOK AT MY SCRIPT. I clearly specified im looking through Text... |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2011 08:47 AM |
Doesn't that just call the variable Text?
|
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 24 Sep 2011 08:49 AM |
TextBox.Changed:connect(function(Text) --Text is right there!, changed event is there!
end)
Ill dumb it down a bit...
function changed(Text) --Text as the argument.
end TextBox.Changed:connect(changed) --Changed event |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2011 08:50 AM |
function changed(Text) print(Text) end TextBox.Changed:connect(changed)
could be ANY property.
He wants to know when the TEXT property is changed.
Changed returns the name of the property changed... |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2011 08:54 AM |
Wait, does he? "Text is a child of TextBox. Text is a StringValue, while Textbox is just a GUI object.
Saying TextBox.Changed isn't specifying what is being changed." just confused me.
property = "Text" TextBox:findFirstChild("Text").Changed:connect(function(p) if p==property then --this kind of thing? end end) |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 24 Sep 2011 08:55 AM |
>function changed(Text) >print(Text) >end >TextBox.Changed:connect(changed) > >could be ANY property.
Any Property???
function changed(Text) --TEXT IS IN THE PARENTHESIS!!!! Thats the argument changed events use! |
|
|
| Report Abuse |
|
|
nike6330
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 154 |
|
|
| 24 Sep 2011 08:56 AM |
| @xv in your script the Text arguement would return the changed property name right?, so its not probably .Text? |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2011 08:58 AM |
@OPer: It's very confusing for debug purposes to call something TextBox and give it a child called Text. it makes me think it is a TextBox and that text is the property.
@xvgigakid: Looked it up. "STRING property" otherwise it's a variable. |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2011 08:59 AM |
TextBox.Text.Changed:connect(function(p) if p=="Value" then
end end)
That? |
|
|
| Report Abuse |
|
|
Aurarus
|
  |
| Joined: 22 Dec 2008 |
| Total Posts: 4761 |
|
|
| 24 Sep 2011 09:00 AM |
Neither of these things worked :\
I just need this script because in my GUI Inventory, whenever an object within it gets selected, the label which says "- Inventory -" suddenly just dissapears. |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 24 Sep 2011 09:01 AM |
@Nike
I use .Changed a LOT! I know what im talking about. If you want everything to be solved just try it out.
Take a NumberValue and put this script in it
script.Parent.Changed:connect(function(Value) print("Number Is Changed") end) |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 24 Sep 2011 09:02 AM |
| It isnt a string property. Just try out my script in a number value and run it. Change the value of NumberValue and see what happens. |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2011 09:03 AM |
@xvgigakid
If you change the name of that value, does it still print? |
|
|
| Report Abuse |
|
|
nike6330
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 154 |
|
|
| 24 Sep 2011 09:05 AM |
| No, He is right. I am sorry, i tested it. |
|
|
| Report Abuse |
|
|