Loyal2One
|
  |
| Joined: 24 Jun 2012 |
| Total Posts: 10155 |
|
|
| 22 Jul 2016 01:06 PM |
I'd like to get a block to take input with a surfacegui and a textbox. How do I do this?
|
|
|
| Report Abuse |
|
|
AxeHeads
|
  |
| Joined: 07 Jan 2016 |
| Total Posts: 840 |
|
| |
|
AxeHeads
|
  |
| Joined: 07 Jan 2016 |
| Total Posts: 840 |
|
|
| 22 Jul 2016 01:09 PM |
if u use a text box then it should work if a player clicks it and starts typing
|
|
|
| Report Abuse |
|
|
AxonMega
|
  |
| Joined: 29 Aug 2014 |
| Total Posts: 2403 |
|
|
| 22 Jul 2016 01:10 PM |
| I think you put the SurfaceGui in StarterGui, and set its adorned to be the block. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2016 01:12 PM |
| Make its parent ScreenGui and have a script change its Adornee to the part you want. |
|
|
| Report Abuse |
|
|
AxonMega
|
  |
| Joined: 29 Aug 2014 |
| Total Posts: 2403 |
|
|
| 22 Jul 2016 01:12 PM |
@KeiRoMultiverse
No, my method is better. |
|
|
| Report Abuse |
|
|
Loyal2One
|
  |
| Joined: 24 Jun 2012 |
| Total Posts: 10155 |
|
|
| 22 Jul 2016 01:18 PM |
Well that makes it show up on the block but I still can't enter input. Do I need a special script?
|
|
|
| Report Abuse |
|
|
Loyal2One
|
  |
| Joined: 24 Jun 2012 |
| Total Posts: 10155 |
|
| |
|
Loyal2One
|
  |
| Joined: 24 Jun 2012 |
| Total Posts: 10155 |
|
|
| 22 Jul 2016 01:20 PM |
Oh, had to make it active. Thanks guys.
|
|
|
| Report Abuse |
|
|
|
| 22 Jul 2016 01:22 PM |
Lool! Sorry, you're right, Axon, I confused StarterGui with ScreenGui. They all look the same to me. XDXD
And hi, Loyal! |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 22 Jul 2016 01:28 PM |
@Axon he basically said the same exact thing. Calm down.
|
|
|
| Report Abuse |
|
|
AxeHeads
|
  |
| Joined: 07 Jan 2016 |
| Total Posts: 840 |
|
|
| 22 Jul 2016 01:28 PM |
@time
I think he was pretty calm...
|
|
|
| Report Abuse |
|
|
Loyal2One
|
  |
| Joined: 24 Jun 2012 |
| Total Posts: 10155 |
|
|
| 22 Jul 2016 01:34 PM |
Okay, so now that it takes text, I'm trying to get it to do something AFTER it takes text. Nothing's happening. Is there a problem with this script?
enteredtext = game.StarterGui.TextBox.Text if enteredtext == "artist" then print("confirmed") game.ServerStorage.artist.Adornee = game.Workspace.Part end
|
|
|
| Report Abuse |
|
|
| |
|
Loyal2One
|
  |
| Joined: 24 Jun 2012 |
| Total Posts: 10155 |
|
| |
|
|
| 22 Jul 2016 01:45 PM |
| Ok hold on, I got a long answer. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2016 01:51 PM |
If so, there are two problems with it. You see, the script will only run once, and since enteredtext doesn't start out as "artist" then it won't print. You'll need to make an event connected to a function so it checks more often. Also, there are a few more problems.
"game.StarterGui.TextBox.Text"
The text in that will never change.
When a game starts, it adds what's in that to each player's PlayerGui.
"game.Players.LocalPlayer.PlayerGui.TextBox.Text" is what you should be looking for.
So here's how the script should look:
game.Players.LocalPlayer.PlayerGui.TextBox.Changed:connect(function() enteredtext = game.Players.LocalPlayer.PlayerGui.TextBox.Text if enteredtext == "artist" then print("confirmed") game.Players.LocalPlayer.artist.Adornee = game.Workspace.Part end end)
Also, I suggest just keeping the "artist" gui inside of StarterGui too. I don't think it'll work from ServerStorage. It's fine, it wont show up anywhere if it doesn't have an Adornee. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2016 01:54 PM |
Wait, change "game.Players.LocalPlayer.artist.Adornee = game.Workspace.Part" to
game.Players.LocalPlayer.PlayerGui.artist.Adornee = game.Workspace.Part
I'm always leaving something out lol. |
|
|
| Report Abuse |
|
|
Loyal2One
|
  |
| Joined: 24 Jun 2012 |
| Total Posts: 10155 |
|
|
| 22 Jul 2016 02:02 PM |
Thank you Kei! I had to play around with the path a little bit. I ended up putting SurfaceGui before Textbox and it worked :)
|
|
|
| Report Abuse |
|
|
Loyal2One
|
  |
| Joined: 24 Jun 2012 |
| Total Posts: 10155 |
|
|
| 22 Jul 2016 02:19 PM |
Well that's strange...It works in studio testing but not in-game
|
|
|
| Report Abuse |
|
|