local TweenService = game:GetService("TweenService") local Module = {} -- Function to…
- User
local TweenService = game:GetService("TweenService")
local Module = {}
-- Function to create a new process circle function Module.NewProcessCircle(gui: Instance, size: number?, space: number?, range: number?) local self = { Parent = gui, Size = size or 10, Space = space or 50, Range = range or 75, Fill = 0, CurrentFill = 0, Colors = { Fill = Color3.new(0.2, 0.8, 0.2), Empty = Color3.new(1, 1, 1) }, Visible = true, Object = Instance.new("Frame", gui) }
code-- Place the parent frame in the middle of the GUI local halfSize = self.Size self.Object.Size = UDim2.new(0, halfSize * 2, 0, halfSize * 2) self.Object.BackgroundTransparency = 1 self.Object.Position = UDim2.new(0.5, -self.Object.Size.X.Offset / 2, 0.5, -self.Object.Size.Y.Offset / 2) -- Initialize the dots for i = 0, self.Range do local alpha = (i / self.Range) * (2 * math.pi) -- full circle in radians (0 to 2π) local dot = Instance.new("Frame", self.Object) dot.Name = tostring(i) dot.Size = UDim2.new(0, self.Size, 0, self.Size) -- Calculate the correct position of each dot dot.Position = UDim2.new( 0, math.cos(alpha) * self.Space + self.Object.Position.X.Offset + halfSize - halfSize, 0, math.sin(alpha) * self.Space + self.Object.Position.Y.Offset + halfSize - halfSize ) dot.AnchorPoint = Vector2.new(0.5, 0.5) -- Center the dot on its own position dot.ZIndex = -i local corner = Instance.new("UICorner", dot) corner.CornerRadius = UDim.new(1, 0) end return setmetatable(self, { __index = Module }) -- Set the metatable for method accessend
-- Method to update the visual representation of the process circle function Module:Step() local percent = self.CurrentFill / 100 local gotoIndex = math.floor(percent * self.Range)
code - Assistant