|
| 24 Oct 2016 09:52 AM |
I have this script:
local sign = game.Workspace.Sign.TextButton
function ClickMe() sign.Text = "I've been clicked!" end
sign.MouseButton1Down:connect(ClickMe)
It's supposed to simply change the text when I click on it. Output says TextButton is not a valid member of part. I know there's a simple answer to this, and I'm probably over thinking this. Any suggestions as to why this isn't working? |
|
|
| Report Abuse |
|
|
L2000
|
  |
| Joined: 03 Apr 2008 |
| Total Posts: 77448 |
|
|
| 24 Oct 2016 10:01 AM |
Is the variable right? Like where is your TextButton located & what's its name |
|
|
| Report Abuse |
|
|
|
| 24 Oct 2016 10:07 AM |
| I assume you used a gui textbutton inside of a part without a billboard/surface gui, use clickdetector instead |
|
|
| Report Abuse |
|
|
|
| 24 Oct 2016 10:13 AM |
| My Textbutton is a child of surfacegui which is a parent of the part. So the variable should be correct, unless I'm missing something. And as for the ClickDetector, can't I use TextButton's without clickdetectors? |
|
|
| Report Abuse |
|
|
|
| 24 Oct 2016 10:16 AM |
"My Textbutton is a child of surfacegui which is a parent of the part."
"local sign = game.Workspace.Sign.TextButton"
You're missing either the oart or surface gui
game.Workspace.Part.Sign.TextButton
or
game.Workspace.Sign.SurfaceGUI.TextButton
|
|
|
| Report Abuse |
|
|
Rerumu
|
  |
| Joined: 11 Oct 2014 |
| Total Posts: 950 |
|
|
| 24 Oct 2016 10:18 AM |
workspace.Sign.SurfaceGui.TextButton
Dont overcomplicate it for him. |
|
|
| Report Abuse |
|
|
|
| 24 Oct 2016 12:57 PM |
| Oh my gosh, that's what I was missing! Thanks guys, I knew I was over thinking it. |
|
|
| Report Abuse |
|
|
|
| 24 Oct 2016 12:59 PM |
Reru, I have seen only a couple of replies from you and so far each time I can't tell if you are trolling or stupid.
Also OP keep in mind TextButtons in the workspace can not be "clicked" from a server script. |
|
|
| Report Abuse |
|
|
|
| 24 Oct 2016 01:01 PM |
| Edit: Actually I believe I was thinking of textBoxs not buttons, although I believe there is some problem with textButtons (Possible a problem getting the player who clicked it? Its been a while.) |
|
|
| Report Abuse |
|
|
Rerumu
|
  |
| Joined: 11 Oct 2014 |
| Total Posts: 950 |
|
|
| 24 Oct 2016 07:36 PM |
| Stop triggering yourself, and if the game isn't FE then there's no problem. |
|
|
| Report Abuse |
|
|
|
| 24 Oct 2016 11:12 PM |
'Stop triggering yourself' No sure what that even means.
'and if the game isn't FE then there's no problem.' No true, you can not type on a text box that is a descendant of the workspace, its been that way before FE even existed. Or if you are talking about me saying you can not get the player who clicked, that also still applies because the event gives no arguments to the function as shown here. http://wiki.roblox.com/index.php?title=API:Class/GuiButton/MouseButton1Click
And with these http://wiki.roblox.com/index.php?title=API:Class/GuiButton/MouseButton1Down http://wiki.roblox.com/index.php?title=API:Class/GuiButton/MouseButton1Up
Although 2 arguments are given, neither of them are the player. |
|
|
| Report Abuse |
|
|
|
| 25 Oct 2016 12:55 AM |
just gonna slip this in
http://wiki.roblox.com/index.php?title=API:Class/SurfaceGui/Adornee |
|
|
| Report Abuse |
|
|
Rerumu
|
  |
| Joined: 11 Oct 2014 |
| Total Posts: 950 |
|
|
| 25 Oct 2016 06:19 AM |
And just like that, 128's triggered argument was destroyed.
Oh and by the way, 128, yes you can type on text boxes in the workspace, but in a non-FE game everyone will see you typing and can interfere. Next time try to not spread misinformation. |
|
|
| Report Abuse |
|
|
|
| 25 Oct 2016 01:58 PM |
I said
"you can not type on a text box that is a descendant of the workspace"
If you put it in the playerGui and set the Adornee its not a descendant of workspace.
http://wiki.roblox.com/index.php?title=API:Class/SurfaceGui
"Note: SurfaceGuis must be descendants of PlayerGui in order to know the player who is interacting with it.
TextBoxes, as descendants of this instance, are locked if the SurfaceGui instance is a descendant of Workspace."
So no, I wasn't wrong. |
|
|
| Report Abuse |
|
|
Rerumu
|
  |
| Joined: 11 Oct 2014 |
| Total Posts: 950 |
|
|
| 25 Oct 2016 02:01 PM |
- Turns off FE. - Puts down SurfaceGui with textbox on it. - Types on it.
Mhm, whatever you say bud. |
|
|
| Report Abuse |
|
|
|
| 25 Oct 2016 02:04 PM |
Let me guess, you are playing in studio aren't you
You are trying so hard to prove me wrong because I offended you |
|
|
| Report Abuse |
|
|
Rerumu
|
  |
| Joined: 11 Oct 2014 |
| Total Posts: 950 |
|
|
| 25 Oct 2016 02:05 PM |
| Or you're trying too hard to prove me wrong because I triggered you so much? Seriously. Go ingame, test it, and then come back to apologize. |
|
|
| Report Abuse |
|
|
|
| 25 Oct 2016 02:09 PM |
| The computer I am currently using can not run roblox studio (Literally found this piece of garbage in my trash can while taking out the trash.) I'm using it because my normal one is broken (Not that it ran games well anyway, but it did run them.) I'll get back to you in a month when I get my new one. I'll go ahead and apologize ahead of time, sorry if I'm wrong I just tried to go by what the wiki said, I've been off roblox for a while due to, well my computer being broken. |
|
|
| Report Abuse |
|
|
Rerumu
|
  |
| Joined: 11 Oct 2014 |
| Total Posts: 950 |
|
|
| 25 Oct 2016 02:11 PM |
| Oki, what you might have been thinking of is BillboardGuis because those dont take input in workspace at all. |
|
|
| Report Abuse |
|
|
|
| 25 Oct 2016 02:14 PM |
| Thats very possible, I also apologize for being rude to you. |
|
|
| Report Abuse |
|
|