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: What's wrong with this ?

Previous Thread :: Next Thread 
Zenuvius is not online. Zenuvius
Joined: 26 Aug 2014
Total Posts: 551
18 Dec 2016 10:11 AM
local x1 = Instance.new("Part")
x1.Anchored = false
x1.CanCollide = true
x1.Transparency = 0.80000001192093
x1.Size = Vector3.new(16, 20, 2)
x1.Position = Vector3.new(-4, 19.400013, 15)
x1.BrickColor = BrickColor.new("Medium stone grey")
x1.Material = Enum.Material.Neon
x1.Rotation = Vector3.new(-0, 0, -0)
x1.BackSurface = Enum.SurfaceType.Smooth
x1.FrontSurface = Enum.SurfaceType.Smooth
x1.BottomSurface = Enum.SurfaceType.Inlet
x1.TopSurface = Enum.SurfaceType.Studs
x1.RightSurface = Enum.SurfaceType.Smooth
x1.LeftSurface = Enum.SurfaceType.Smooth
x1.Locked = true
x1.Name = "test"
x1.Parent = workspace

local sg = Instance.new("SurfaceGui")
sg.Face = Enum.NormalId.Front
sg.Name = "SurfaceGui"
sg.Parent = x1

local f = Instance.new("Frame")
f.BackgroundColor3 = Color3.new(1, 1, 1)
f.BorderColor3 = Color3.new(0.105882, 0.164706, 0.207843)
f.BackgroundTransparency = 1
f.BorderSizePixel = 1
f.Position = UDim2.new({0, 0}, {0, 0})
f.Size = UDim2.new({1, 0}, {1, 0})
f.Name = "Frame"
f.Parent = sg

local tb = Instance.new("TextButton")
tb.BackgroundColor3 = Color3.new(0.203922, 0.203922, 0.203922)
tb.BorderColor3 = Color3.new(1, 1, 1)
tb.BackgroundTransparency = 0
tb.BorderSizePixel = 5
tb.Position = UDim2.new({0.100000001, 0}, {0.100000001, 0})
tb.Size = UDim2.new({0.800000012, 0}, {0.100000001, 0})
tb.Font = En#################tb.FontSize = Enum.FontSize.Size14
tb.Text = "Click me"
tb.TextColor3 = Color3.new(0.105882, 0.164706, 0.207843)
tb.TextStrokeColor3 = Color3.new(1, 1, 1)
tb.TextTransparency = 1
tb.TextStrokeTransparency = 0
tb.TextScaled = true
tb.TextWrapped = true
tb.Visible = true
tb.Name = "TextButton"
tb.Parent = f



==========================================


Technically this should create a part with a textbutton that says Click me ?

But it doesn't do that and I am insanely confused why,
I've looked into the parts created in studio and the problem seems to lie in the frame and the textbutton.

For some reason, both of them have 0,0 for both absolutePosition and absoluteSize.

Anyone can help me fix the issue here ?

Copy the script I posted above and run it in your studio's command bar, it creates everything fine, part, surfacegui, frame, textbutton but the problem is the frame and textbutton won't show up T_T
Report Abuse
Zenuvius is not online. Zenuvius
Joined: 26 Aug 2014
Total Posts: 551
18 Dec 2016 10:12 AM
Either I'm making a careless mistake I'm not noticing or I'm unaware of something I should have known...or both T_T
Report Abuse
Zenuvius is not online. Zenuvius
Joined: 26 Aug 2014
Total Posts: 551
18 Dec 2016 10:17 AM
the hashtagged part is tb.Font = ################# tb.FontSize = Enum.FontSize.Size14
Report Abuse
Zenuvius is not online. Zenuvius
Joined: 26 Aug 2014
Total Posts: 551
18 Dec 2016 10:18 AM
##############################################################
Report Abuse
Zenuvius is not online. Zenuvius
Joined: 26 Aug 2014
Total Posts: 551
18 Dec 2016 10:19 AM
###################################################################################
Report Abuse
Zenuvius is not online. Zenuvius
Joined: 26 Aug 2014
Total Posts: 551
18 Dec 2016 10:20 AM
ZZZZZzz. I can't post the full script, roblox keep hashtagging that line with tb.Font


the line is

tb.Font = "Fantasy"

tb.FontSize = "Size14"
Report Abuse
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
18 Dec 2016 10:24 AM
Did you make this on that 79p app that allows you to make GUI or something?


Report Abuse
clc02 is not online. clc02
Joined: 30 Dec 2007
Total Posts: 7393
18 Dec 2016 10:27 AM
f.Size = UDim2.new({1, 0}, {1, 0})
UDim2.new(1,0,1,0)
Not two tables.
Report Abuse
Zenuvius is not online. Zenuvius
Joined: 26 Aug 2014
Total Posts: 551
18 Dec 2016 10:36 AM
* Facepalm *

I overlooked that.

No I made a converter that prints every object I build in the workspace into lines of script, so basically I can build a house in studio, run the game, and it will print that entire house in Instance.new script with the same position etc.

As for the Size, I did this,

local siz = tostring(v.Size)

then I set the size of the frame to UDim2.new("..siz..")")


Overlooked the fact that tostring(v.Size) prints it in two tables ;_;

Is there a simple way to make it print it in one table ?
Report Abuse
Zenuvius is not online. Zenuvius
Joined: 26 Aug 2014
Total Posts: 551
18 Dec 2016 10:42 AM
the only way I managed to figure going about with this is making,

local sizX = tostring(v.Size.X)
local sizY = tostring(v.Size.Y)

and then setting the size to UDim2.new("..sizX..","..sizY..")
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