What @David0fficial_BR said in the comments, if you need a visual example I can provide one:
local TweenService = game:GetService("TweenService")
local inAction = false
local tweenTime = 10
event
if not inAction then
inAction = true
if statement then
TweenService:Create(obj, TweenInfo.new(tweenTime), {data}):Play()
else
TweenService:Create(obj, TweenInfo.new(tweenTime), {data}):Play()
end
wait(tweenTime)
inAction = false
end
end)
This is only for visual examples, you can copy the format but not the contents of the code since it will not work if you straight up copy paste. Add any other variables / items you need just include the debounce / cooldown.
1 comment
Set up a debounce, while the tween is running, it won't do a thing.