I want to try creating a cash animation when a player earns cash, so like a bunch of icons are created, and they kinda spray out like a fountain, or something a long those lines. What I’ve got at the moment is pretty pathetic tho
local TweenService = game:GetService('TweenService')
local function CreateCash()
local Cash = Instance.new('ImageLabel')
Cash.AnchorPoint = Vector2.new(0.5, 0)
Cash.BackgroundTransparency = 1
Cash.Position = UDim2.new(0.5, 0, 1, 0)
Cash.Size = UDim2.new(0.9, 0, 0.9, 0)
Cash.Image = 'http://www.roblox.com/asset/?id=2283894564'
Cash.ScaleType = Enum.ScaleType.Fit
local AspectRatio = Instance.new('UIAspectRatioConstraint')
AspectRatio.Parent = Cash
return Cash
end
return function(parent)
for i = 1, 20 do
local Cash = CreateCash()
Cash.Parent = parent
local Move = TweenService:Create(
Cash,
TweenInfo.new(0.5),
{Position = UDim2.new(math.random(10, 100) / 100, 0, math.random(10, 100) / 100, 0)}
)
Move:Play()
end
end