So I made a function that allows me to make GuiButtons,this function has five arguments:
.Size
.Position
.ButtonSize
.ButtonPositon
.PlayerImage
.Parent
but when I put them in I get an error saying:
Workspace.Script:35: ')' expected near ','
How would I add a UDim value you to this argument?
function CreateButton(Size,Position,ButtonSize,ButtonPosition,PlayerImage,Parent) ----------------------ObjectTable---------------------- local Objects = {} ----------------------Button---------------------- local Button = Instance.new("TextButton",Parent) Button.Style = Enum.ButtonStyle.RobloxRoundButton Button.Size = UDim2.new(ButtonSize) Button.Text = "PlayerName" Button.Name = "Button" Button.Position = UDim2.new(ButtonPosition) table.insert(Objects,Button) ----------------------ButtonUnderImage---------------------- local Buttonunderimage = Instance.new("Frame",Parent) Buttonunderimage.Style = Enum.FrameStyle.DropShadow Buttonunderimage.Size = UDim2.new(Size) Buttonunderimage.Name = "ButtonUnderImage" Buttonunderimage.Position = UDim2.new(Position) table.insert(Objects,Buttonunderimage) ----------------------PlayerImage---------------------- local PlayerImage = Instance.new("ImageLabel",Parent) PlayerImage.BackgroundTransparency = 1 PlayerImage.Image = PlayerImage PlayerImage.Name = "PlayerImage" PlayerImage.Position = UDim2.new(Position) PlayerImage.Size = UDim2.new(Size) table.insert(Objects,PlayerImage) ----------------------Returninig---------------------- return(Objects) end Button = CreateButton((0.2,0),0.14, 0), (0.02, 0,0.02, 0), (0.2, 0,0.14, 0), (0.08, 0,0.13, 0), 0, game.Player.PlayerGui.ScreenGui) --[[(0.2,0),0.14, 0)- Size (0.02, 0,0.02, 0)- Position (0.2, 0,0.14, 0) -ButtonSize (0.08, 0,0.13, 0)- ButtonPosition 0 -Player Image (I don't want any yet) game.Player.PlayerGui.ScreenGui-Parent --]] for i,v in pairs (Button) do print(v) end
I believe that line 36 should be ]]--
, not --]]
.