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 » Scripting Helpers
Home Search
 

Re: Failed to display a Textbox by script.

Previous Thread :: Next Thread 
thetruck8866 is not online. thetruck8866
Joined: 15 May 2011
Total Posts: 1197
02 Jun 2014 10:36 PM
I am trying to display a Textbox with text in it and afterwards it changes what it says. So far it doesn't even show a TextBox. Fix it or tell me I am doing it completely wrong? I'm still a newbie at Lua.

while true do
lk = Instance.new("ScreenGUI")
lk.Parent = Game.StarterGui
Lkm = Instance.new("TextBox")
Lkm.Parent = Game.StartGui.lk
Lkm.BackgroundColor3 = 46, 255, 0
Lkm.BackgroundTransparency = .3
Lkm.BorderSizePixel = 3
Lkm.Position = {0.05, 0},{0.025, 0}
Lkm.Size = {0, 310},{0, 30}
wait(1)
Lkm.Text = "X"
wait(5)
Lkm.Text = "Y"
wait(5)
Lkm.Text = "Z"
end
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
02 Jun 2014 10:39 PM
GUI Size and Position are measured in UDim2

Lkm.Position = UDim2.new(0.05, 0, 0.025, 0)
Lkm.Size = UDim2.new(0., 310, 0, 30)
Report Abuse
thetruck8866 is not online. thetruck8866
Joined: 15 May 2011
Total Posts: 1197
02 Jun 2014 11:23 PM
I fixed that part but I still see no Gui in-game. Anyone else see anything?
Report Abuse
thetruck8866 is not online. thetruck8866
Joined: 15 May 2011
Total Posts: 1197
02 Jun 2014 11:36 PM
I am thinking that it is because ScreenGui is not a valid instance, so, instead of Instance.new("ScreenGUI") is there anything I can replace it with to make it work?
Report Abuse
Brickman2010 is not online. Brickman2010
Joined: 20 Nov 2009
Total Posts: 5547
03 Jun 2014 12:07 AM
Oh, then it was spelled wrong. I think it goes Instance.new("ScreenGui") instead of "ScreenGUI"
Report Abuse
thetruck8866 is not online. thetruck8866
Joined: 15 May 2011
Total Posts: 1197
03 Jun 2014 01:27 AM
Nticed a bunch of things wrong, fixed most of them, I think this the the last problem, how do you set the background color of the textbox? On output it just says, "Workspace.Script:6: bad argument #3 to 'BackgroundColor3' (Color3 expected, got number)"
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
03 Jun 2014 01:55 AM
If you're doing it right and putting 3 numbers, you must be putting an invalid number for a color3 I guess
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
03 Jun 2014 04:19 AM
here

lk = Instance.new("ScreenGui")
lk.Parent = Game.StarterGui
Lkm = Instance.new("TextBox")
Lkm.Parent = lk
Lkm.BackgroundColor3 = Color3.new(46/255, 255/255, 0/255)
Lkm.BackgroundTransparency = .3
Lkm.BorderSizePixel = 3
Lkm.Position = UDim2.new(0.05, 0, 0.025, 0)
Lkm.Size = UDim2.new(0, 310, 0, 30)
wait(1)
Lkm.Text = "X"
wait(5)
Lkm.Text = "Y"
wait(5)
Lkm.Text = "Z"
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
03 Jun 2014 06:07 AM
You could do it like Stealth said, or
Lkm.BackgroundColor3 = BrickColor.new("Bright red").Color
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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