Here’s how you would calculate the random positions in a circular shape:
local an = math.random(0,360)
local mag = math.random(35, 70)
local x = math.sin(an) * mag
local y = math.cos(an) * mag
Then, just offset it via a newly made ImageLabel’s Position, and use the TweenService to create a standard tween instance to play for the label. Only the tween duration is required as everything else is automatically filled. Then, just repeat that protocol several times via a for i=1, 10 do loop.
Further details require researching how to use the TweenService and some understanding of using UDim2 values in Guis.
I would fully detail it all, but I am currently busy at the moment.
EDIT: @Forummer deserves the Solution mark on this one.
local Game = game
local Debris = Game:GetService("Debris")
local Tweens = Game:GetService("TweenService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Mouse = Player:GetMouse()
local PlayerGui = Player:FindFirstChildOfClass("PlayerGui")
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Parent = PlayerGui
local _Random = Random.new()
local function OnClick()
for _ = 1, 10 do
local ImageLabel = Instance.new("ImageLabel")
ImageLabel.Position = UDim2.new(0, Mouse.X, 0, Mouse.Y)
ImageLabel.Size = UDim2.new(0, 15, 0, 15)
Debris:AddItem(ImageLabel, 1)
ImageLabel.Parent = ScreenGui
local Tween = Tweens:Create(ImageLabel, TweenInfo.new(0.5), {Position = ImageLabel.Position + UDim2.new(0, _Random:NextInteger(-60, 60), 0, _Random:NextInteger(-60, 60))})
Tween:Play()
end
end
Mouse.Button1Down:Connect(OnClick)
The pattern isn’t even circular, it just appears as such as the cursor’s position is the center point.