I need help making a cooldown indicator system similar to A Universal Time, where they appear and disappear whenever you use a move and whenever they are finished and you can use the move again, and also new cooldowns are added under the current ones and move up when the gui is no longer visible.
This is the code Im using currently, it works now but i know Im going to have issues when trying to script in more guis and make them all work, i just need to figure out if there are different and more efficient methods i can use, and this is only for two cooldowns...
local plr = game:GetService("Players").LocalPlayer
local chr = plr.Character or plr.CharacterAdded:Wait()
local cs = game:GetService("CollectionService")
local plrgui = plr.PlayerGui
local barragecd = plrgui.Cooldowns.barrage
local dashcd = plrgui.Cooldowns.dash
while true do
if cs:HasTag(chr,"BarrageCD") and not barragecd.Visible == true then
barragecd.Visible = true
barragecd.cd:TweenSize(UDim2.new(0,0,0,11),"In","Linear",6,true)
delay(6, function()
barragecd.Visible = false
barragecd.cd:TweenSize(UDim2.new(0, 200,0, 11),"In","Linear",0.01,true)
end)
end
if cs:HasTag(chr, "ROLLCD") and not dashcd.Visible == true then
dashcd.Visible = true
dashcd.cd:TweenSize(UDim2.new(0,0,0,11),"In","Linear",6,true)
delay(6, function()
dashcd.Visible = false
dashcd.cd:TweenSize(UDim2.new(0, 200,0, 11),"In","Linear",0.01,true)
end)
end
if dashcd.Visible == true and barragecd.Visible == false then
barragecd:TweenPosition(UDim2.new(0.93, 0,0.264, 0),"In","Linear",0.01,true)
dashcd:TweenPosition(UDim2.new(0.93, 0,0.187, 0),"In","Linear",0.01,true)
elseif dashcd.Visible == false and barragecd.Visible == true then
dashcd:TweenPosition(UDim2.new(0.93, 0,0.264, 0),"In","Linear",0.01,true)
barragecd:TweenPosition(UDim2.new(0.93, 0,0.187, 0),"In","Linear",0.01,true)
elseif dashcd.Visible == false and barragecd.Visible == false then
barragecd:TweenPosition(UDim2.new(0.93, 0,0.187, 0),"In","Linear",0.01,true)
dashcd:TweenPosition(UDim2.new(0.93, 0,0.187, 0),"In","Linear",0.01,true)
end
wait()
end

1 comment
thank you, i will try to implement this