Skip to content

Instantly share code, notes, and snippets.

@Nimblz
Created April 5, 2020 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Nimblz/f8d9a190cfee855e911bab9ceaa8e73f to your computer and use it in GitHub Desktop.
Save Nimblz/f8d9a190cfee855e911bab9ceaa8e73f to your computer and use it in GitHub Desktop.
-- Author: Nimblz (Austin Reuschle)
-- @123eee555
-- extremely simple mass gui element tweener
-- designed with basic 2d particle fx in mind
local TweenService = game:GetService("TweenService")
return function(parent, numParticles, tweenInfo, initialPropsFunc, finalPropsFunc)
numParticles = numParticles or 5
tweenInfo = tweenInfo or TweenInfo.new(
1,
Enum.EasingStyle.Quad,
Enum.EasingDirection.Out
)
for particleIdx = 1, numParticles do
local newParticle = Instance.new("ImageLabel")
local initialProps = initialPropsFunc(particleIdx)
for prop, value in pairs(initialProps) do
local isValidProp = pcall(function()
return newParticle[prop] ~= nil
end)
if isValidProp then
newParticle[prop] = value
end
end
newParticle.Parent = parent
local finalProps = finalPropsFunc(particleIdx, initialProps)
local particleTween = TweenService:Create(newParticle, tweenInfo, finalProps)
particleTween.Completed:Connect(function()
newParticle:Destroy()
end)
particleTween:Play()
end
end
@JhostynFoley
Copy link

Te extrañamos <3 :'3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment