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: Is this possible?

Previous Thread :: Next Thread 
Loyal2One is not online. 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 is online. AxeHeads
Joined: 07 Jan 2016
Total Posts: 840
22 Jul 2016 01:09 PM
textbox?


Report Abuse
AxeHeads is online. 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 is not online. 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
KeiRoMultiverse is not online. KeiRoMultiverse
Joined: 16 Aug 2013
Total Posts: 1896
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 is not online. AxonMega
Joined: 29 Aug 2014
Total Posts: 2403
22 Jul 2016 01:12 PM
@KeiRoMultiverse

No, my method is better.
Report Abuse
Loyal2One is not online. 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 is not online. Loyal2One
Joined: 24 Jun 2012
Total Posts: 10155
22 Jul 2016 01:19 PM
Oh and Hi Kei ;)


Report Abuse
Loyal2One is not online. Loyal2One
Joined: 24 Jun 2012
Total Posts: 10155
22 Jul 2016 01:20 PM
Oh, had to make it active. Thanks guys.


Report Abuse
KeiRoMultiverse is not online. KeiRoMultiverse
Joined: 16 Aug 2013
Total Posts: 1896
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 is not online. 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 is online. AxeHeads
Joined: 07 Jan 2016
Total Posts: 840
22 Jul 2016 01:28 PM
@time

I think he was pretty calm...


Report Abuse
Loyal2One is not online. 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
KeiRoMultiverse is not online. KeiRoMultiverse
Joined: 16 Aug 2013
Total Posts: 1896
22 Jul 2016 01:42 PM
Is this the whole script?
Report Abuse
Loyal2One is not online. Loyal2One
Joined: 24 Jun 2012
Total Posts: 10155
22 Jul 2016 01:43 PM
Yes.


Report Abuse
KeiRoMultiverse is not online. KeiRoMultiverse
Joined: 16 Aug 2013
Total Posts: 1896
22 Jul 2016 01:45 PM
Ok hold on, I got a long answer.
Report Abuse
KeiRoMultiverse is not online. KeiRoMultiverse
Joined: 16 Aug 2013
Total Posts: 1896
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
KeiRoMultiverse is not online. KeiRoMultiverse
Joined: 16 Aug 2013
Total Posts: 1896
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 is not online. 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 is not online. 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
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