Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local uilib = {windows = {}, open = true}
- function uilib:Create(class, properties)
- properties = typeof(properties) == "table" and properties or {}
- local inst = Instance.new(class)
- for property, value in next, properties do
- inst[property] = value
- end
- return inst
- end
- function createholder(holderTitle, parent, parentTable, subHolder)
- local size = subHolder and 35 or 46
- parentTable.main = uilib:Create("Frame", {
- LayoutOrder = subHolder and parentTable.position or 0,
- Position = UDim2.new(0, 20 + (250 * (parentTable.position or 0)), 0, 20),
- Size = UDim2.new(0, 230, 0, size),
- BackgroundTransparency = .5;
- ClipsDescendants = true,
- Parent = parent
- })
- local title = uilib:Create("TextLabel", {
- Size = UDim2.new(1, 0, 0, size),
- BackgroundTransparency = subHolder and 0 or 1,
- BackgroundColor3 = Color3.fromRGB(10, 10, 10),
- BorderSizePixel = 0,
- Text = holderTitle,
- TextSize = subHolder and 16 or 17,
- Font = Enum.Font.GothamBold,
- TextColor3 = Color3.fromRGB(255, 255, 255),
- Parent = parentTable.main
- })
- end
- local function loadOptions(option, holder)
- for _,newOption in next, option.options do
- --[[ if newOption.type == "label" then
- createLabel(newOption, option)
- elseif newOption.type == "toggle" then
- createToggle(newOption, option)
- elseif newOption.type == "button" then
- createButton(newOption, option)
- elseif newOption.type == "list" then
- createList(newOption, option, holder)
- elseif newOption.type == "box" then
- createBox(newOption, option)
- elseif newOption.type == "bind" then
- createBind(newOption, option)
- elseif newOption.type == "slider" then
- createSlider(newOption, option)
- elseif newOption.type == "color" then
- createColor(newOption, option, holder)
- elseif newOption.type == "folder" then
- newOption:init()
- end]]
- end
- end
- function uilib:CreateWindow(title)
- local window = {title = tostring(title), options = {}, open = true, canInit = true, init = false, position = #self.windows}
- table.insert(uilib.windows, window)
- return window
- end
- function uilib:Init()
- self.base = self.base or self:Create("ScreenGui")
- if syn and syn.protect_gui then
- syn.protect_gui(self.base)
- elseif get_hidden_gui then
- get_hidden_gui(self.base)
- else
- game:GetService"Players".LocalPlayer:Kick("Error: protect_gui function not found")
- return
- end
- self.base.Parent = game.Players.LocalPlayer.PlayerGui
- self.base.Name = "uwuware"
- for _, window in next, self.windows do
- if window.canInit and not window.init then
- window.init = true
- createholder(window.title, self.base, window)
- --loadOptions(window)
- end
- end
- end
- return uilib
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement