Billboard Effect Stack

Im trying do buff and debuffs
but making billboars its huge problem for me
my script

local function CreateGui(target,name,duration)
	coroutine.wrap(function()
		if connection == nil then
			connection = target.Head.ChildRemoved:Connect(function(removed)
				if CollectionService:HasTag(removed,"Effect") then
					for i,v in pairs(target.Head:GetChildren()) do
						if v ~= nil and v:IsA("BillboardGui") and CollectionService:HasTag(v,"Effect") == true then
							v.StudsOffset = v.StudsOffset - Vector3.new(i,0,0)
						end
					end
				end
			end)
		end
		local CurrentEffects = -1
		local Gui = script:FindFirstChild(name):Clone()
		Gui.Parent = target.Head
		for i,v in pairs(target.Head:GetChildren()) do
			if v ~= nil and v:IsA("BillboardGui") and CollectionService:HasTag(v,"Effect") == true then
				v.StudsOffset = v.StudsOffset - Vector3.new(1,0,0)
				CurrentEffects = CurrentEffects + 1
			end
		end
		Gui.StudsOffset = Vector3.new(CurrentEffects,2.3,0)
		wait(duration)
		Gui:Destroy()
	end)()
end

Problem video:

2 Likes

Reveiving this topic again, since i need help.
But for not making this message blank ill show what i tried to do

Bruh how about you use a UIGridLayout Object. It does everything you’re trying to do without any code needed.

1 Like

Oh rly? never heard/used that before. Can i get some explanations?

Its like the UiListLayout, but it also does grids, like his name says. You can put the separation in the CellPadding, and then you just have to remove the hearts.

where do i need put UIGridLayout, to Billboard or to ImageLabel in it

How it works basically is you put the UIGridLayout under the Object that the other objects are going to be sorted in. The UIGridLayout will handle the constraints of the sizes and positions and layout etc… by its properties. So yours should look something like this

1 Like

In the Parent of the ImageLabel

In the parent of the 3 ImageLabels.

Its like a UiListLayout, but you can change the distance with CellPadding or the size of the cells with CellSize

1 Like

Alrgiht thank everyone who helped.

1 Like

No problem! Remember to put the category at resolved. Have a nice day!