Check for TweenInfo existence before use

fixed check fail
This commit is contained in:
sindri 2026-03-03 13:49:09 +01:00 committed by GitHub
parent 042d56bf73
commit 8ca9e9b440
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,11 +1,13 @@
-- src/tween.luau
local TweenService = game and game:GetService("TweenService") or nil
local HasTweenInfo = (TweenInfo ~= nil)
-- Factory: inject action + cleanup so tweens are stopped on scope destruction
return function(action, cleanup)
local tween = {}
-- Presets (simple, useful)
if HasTweenInfo then
tween.presets = {
instant = TweenInfo.new(0),
fast = TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),