Advertisement
ProScripter29

Happy's GUI Library

Dec 7th, 2022
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.74 KB | Gaming | 0 0
  1. -- Created by HappyH0lidays2021 --
  2.  
  3. -- This script is useful for creating Guis in client-sided scripts
  4.  
  5. local Script = {}
  6.  
  7. -----------------------------------------------
  8. -- Functions
  9. -----------------------------------------------
  10.  
  11. function Script.Create(Parent, PropertiesTable)
  12.     local New = Instance.new("ScreenGui", Parent)
  13.     New.Name = "_create"
  14.     New.ResetOnSpawn = PropertiesTable[1]
  15.     New.IgnoreGuiInset = PropertiesTable[2]
  16.     New.Enabled = PropertiesTable[3]
  17.     return New
  18. end
  19.  
  20. function Script.MakeFrame(Parent, PropertiesTable)
  21.     local New = Instance.new("Frame", Parent)
  22.     New.Name = "_frame"
  23.     New.Position = PropertiesTable[1]
  24.     New.Size = PropertiesTable[2]
  25.     New.BackgroundColor3 = PropertiesTable[3]
  26.     New.BackgroundTransparency = PropertiesTable[4]
  27.     New.BorderColor3 = PropertiesTable[5]
  28.     New.BorderMode = PropertiesTable[6]
  29.     New.BorderSizePixel = PropertiesTable[7]
  30.     New.Visible = PropertiesTable[8]
  31.     return New
  32. end
  33.  
  34. function Script.MakeButton(Parent, PropertiesTable, TextProperties)
  35.     local New = Instance.new("TextButton", Parent)
  36.     New.Name = "_button"
  37.     New.Position = PropertiesTable[1]
  38.     New.Size = PropertiesTable[2]
  39.     New.AutoButtonColor = PropertiesTable[3]
  40.     New.BackgroundColor3 = PropertiesTable[3]
  41.     New.BackgroundTransparency = PropertiesTable[4]
  42.     New.BorderColor3 = PropertiesTable[5]
  43.     New.BorderMode = PropertiesTable[6]
  44.     New.BorderSizePixel = PropertiesTable[7]
  45.     New.Visible = PropertiesTable[8]
  46.     New.Text = TextProperties[1]
  47.     New.TextColor3 = TextProperties[2]
  48.     New.TextSize = TextProperties[3]
  49.     New.Font = TextProperties[4]
  50.     New.TextScaled = TextProperties[5]
  51.     New.TextStrokeColor3 = TextProperties[6]
  52.     New.TextTransparency = TextProperties[7]
  53.     New.TextWrapped = TextProperties[8]
  54.     return New
  55. end
  56.  
  57. return Script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement