Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lib = {}
- -- Create a new frame
- function lib.Frame.new()
- local self = {}
- self.GuiObject = Instance.new("Frame")
- self.GuiObject.BackgroundColor3 = Color3.new(1, 1, 1)
- self.GuiObject.BackgroundTransparency = 0.5
- self.GuiObject.BorderColor3 = Color3.new(0, 0, 0)
- self.GuiObject.BorderSizePixel = 2
- self.GuiObject.Position = UDim2.new(0.5, -125, 0.5, -100)
- self.GuiObject.Size = UDim2.new(0, 250, 0, 200)
- -- Ready the GUI for rendering
- function self:Ready()
- self.GuiObject.Name = "SynGUI_" .. tostring(self)
- end
- -- Resize the GUI
- function self:Resize()
- self.GuiObject.Size = UDim2.new(0, 250, 0, 200)
- end
- -- Render the GUI
- function self:Render()
- self.GuiObject.Parent = game:GetService("CoreGui")
- end
- return self
- end
- -- Create a new button
- function lib.Button.new(parent, text)
- local self = {}
- self.GuiObject = Instance.new("TextButton")
- self.GuiObject.BackgroundColor3 = Color3.new(1, 1, 1)
- self.GuiObject.BackgroundTransparency = 0.5
- self.GuiObject.BorderColor3 = Color3.new(0, 0, 0)
- self.GuiObject.BorderSizePixel = 2
- self.GuiObject.Position = UDim2.new(0.5, -50, 0.5, -25)
- self.GuiObject.Size = UDim2.new(0, 100, 0, 50)
- self.GuiObject.Font = Enum.Font.SourceSans
- self.GuiObject.Text = text
- self.GuiObject.TextColor3 = Color3.new(0, 0, 0)
- self.GuiObject.TextSize = 20
- -- Connect a function to run when the button is activated
- function self:Connect(event, func)
- self.GuiObject[event]:Connect(func)
- end
- -- Parent the button to a GUI frame
- self.GuiObject.Parent = parent.GuiObject
- return self
- end
- return lib
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement