i am making a game were once you click you instence a frame and they should move to the center but i dont know how to use collectionservice to move them all automaticly to the center

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local mouse = player:GetMouse()
local CollectionService = game:GetService("CollectionService")

mouse.Button1Down:Connect(function()
	local dot = Instance.new("Frame")
	CollectionService:AddTag(dot,"Dot")
	local TaggedParts = CollectionService:GetTagged(dot)
	dot:TweenPosition(UDim2.new(0.495, 0,0.239, 0),"Out","Sine",1)
dot.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
dot.Position = UDim2.new(0,mouse.X - 10, 0,mouse.Y + 25 )
    dot.Size = UDim2.new(0, 15, 0, 15)
	    dot.BorderSizePixel = 0
	dot.Name = "Dot"
dot.Parent = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame
end)

2 comments

0

where did you get the code

0

https://idownvotedbecau.se/noeffort/ Please try to edit the code to the best of your knowledge