Cooldowns problem with gui

cooldowns problem.So basically while i was tweening a ui and i was clicking the icon that was created with TopBarPlus I realized that every time i click the button it takes 3 or 2 seconds to do it again how do i fix it?
Script:
local Icon = require(game:GetService(“ReplicatedStorage”).Icon)
local icon = Icon.new()
local frame = script.Parent
local ts = game:GetService(“TweenService”)
icon:setImage(6031265976)
icon.selected:Connect(function()
frame.Visible = true
frame:TweenPosition(UDim2.new(0.347,0,0.229,0))
icon.deselected:Connect(function()
frame:TweenPosition(UDim2.new(0.347,0,2,0))

end)
	end)
1 Like