Hiya! I’ve been working on something, and I have this GUI, which creates small little GUIs that tell you how long a cooldown is. However, they stack on eachother if multiple are made. How would I combat this?
game.ReplicatedStorage.Remotes.CreateCooldown.OnClientEvent:Connect(function(ReloadTime, AttackType, AbilityName)
task.spawn(function()
local myTweenInfo = TweenInfo.new(ReloadTime, Enum.EasingStyle.Linear)
local gui = game.Lighting.CooldownBase.CooldownFrame:Clone()
table.insert(allcooldowns,gui)
gui:SetAttribute("Line",cooldownsactive + 1)
gui.Parent = script.Parent
gui.AbilityName.Text = AbilityName
gui.Container.TextLabel.Text = AttackType
gui.Position = UDim2.new(0.704,0,0.096 + gui:GetAttribute("Line") / 10 ,0)
--fixpos()
--fixline("+")
cooldownsactive = cooldownsactive + 1
oldnum = cooldownsactive - 1
local myTween = game:GetService("TweenService"):Create(gui:FindFirstChild("ProgressFrame", true), myTweenInfo, {Size = UDim2.new(1, 0, 1, 0)})
myTween:Play()
task.wait(ReloadTime)
--fixline("-")
cooldownsactive = cooldownsactive - 1
oldnum = cooldownsactive + 1
-- fixpos()
gui:Destroy()
end)
end)
THE SCRIPT;