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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 26 Aug 2014 |
| Total Posts: 551 |
|
|
| 18 Dec 2016 10:18 AM |
| ############################################################## |
|
|
| Report Abuse |
|
|
Zenuvius
|
  |
| Joined: 26 Aug 2014 |
| Total Posts: 551 |
|
|
| 18 Dec 2016 10:19 AM |
| ################################################################################### |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|