Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 20 Oct 2012 10:13 PM |
script.Parent.Text.Changed:connect(function(text) imagetext = script.Parent.Parent.Parent.ImageLabel local avatarUrl = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username=" .. text imagetext.Image = avatarUrl wait(1) imagetext.BackgroundTransparency = 0 -- do something with avatarUrl end)
in local script.
Hierarchy is right I think. |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2012 10:16 PM |
What's text?
http://www.roblox.com/CeaselessSouls-Admin-Commands-Gui-based-item?id=92856199 -- Take one and enjoy! Read the description, has a lot of information. |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
| |
|
Joalmo
|
  |
| Joined: 28 Jun 2009 |
| Total Posts: 1160 |
|
|
| 20 Oct 2012 10:19 PM |
| script.Parent.Text.Changed:connect(function(text) -- in this line, "(text)" isn't the name of the function, but the argument to be passed into the function. Anonymous functions don't get names. |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2012 10:20 PM |
Text is a property, the .Changed event cannot act on a property, only an object
script.Parent.Changed:connect(function(text) if text=="Text"then --code
That should work. |
|
|
| Report Abuse |
|
|
Joalmo
|
  |
| Joined: 28 Jun 2009 |
| Total Posts: 1160 |
|
|
| 20 Oct 2012 10:21 PM |
| Wait, sorry, I misread this. Disregard my post. |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2012 10:21 PM |
script.Parent.Text.Changed:connect(function(text) imagetext = script.Parent.Parent.Parent.ImageLabel local avatarUrl = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username=" .. text.Text imagetext.Image = avatarUrl wait(1) imagetext.BackgroundTransparency = 0 -- do something with avatarUrl end) |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
| |
|
|
| 20 Oct 2012 10:34 PM |
Mine didn't work? Then get rid of the 'if text=="Text"then' line
That event might not return the type of property changed and the value itself. |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 20 Oct 2012 10:35 PM |
| @wood Your script won't work because I want this to be free, like any text not just one. |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2012 10:37 PM |
| I don't understand, can you please describe the hierarchy? |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 20 Oct 2012 10:39 PM |
_STARTERGUI
--ScreenGui -ImageLabel -Frame (INSIDE FRAME) TextBox (SCRIPT INSIDE OF TEXTBOX) TextLabel
|
|
|
| Report Abuse |
|
|
|
| 20 Oct 2012 10:40 PM |
| Where is the script in that? |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
| |
|
|
| 20 Oct 2012 10:41 PM |
Oops, ignore that... I'm blind.
So the script should work for the Text property in the TextBox, right? |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
| |
|
|
| 20 Oct 2012 10:45 PM |
| Then simply using script.Parent.Changed should work correctly, I don't see the problem |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
| |
|
|
| 21 Oct 2012 01:17 PM |
script.Parent.Text.Changed:connect(function(text) imagetext = script.Parent.Parent.Parent.ImageLabel local avatarUrl = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username=" .. text imagetext.Image = avatarUrl wait(1) imagetext.BackgroundTransparency = 0 -- do something with avatarUrl end)
GUI = script.Parent; GUI.Changed:connect(function(property) if (property == "Text") then local imagetext = GUI.Parent.Parent.ImageLabel; local avatarUrl = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username="..GUI.Text; imagetext.Image = avatarUrl; wait(1) imagetext.BackgroundTransparency = 0; end end) |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2012 01:17 PM |
| Don't mind the top one, forgot to delete your script. |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
| |
|