Hello, I have an animation module here for my gui that is meant to pick random things from a table to appear in the roll animation. Everything works fine apart from the fact that it only picks the selected one (that they are actually going to get) and replays that. How can I make it choose random things sorta like a case opening animation.
Animation Module:
local TweenService = game:GetService('TweenService')
local info = TweenInfo.new(.2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local function animateText(text1, text2, roll, RollInfo)
text1.Position = UDim2.fromScale(.404, 0.096)
text1.Text = roll
text2.Text = '1 in '..RollInfo[roll].weight
TweenService:Create(text1, info, {Position = UDim2.fromScale(.404, .415)}):Play()
wait(.2)
end
return {
rollAnimation = function(RollGui, roll, RollInfo)
local RollingFrame = RollGui
local Auras = require(game.ReplicatedStorage.Auras)
local RollText = RollGui:WaitForChild('AuraLabel')
local Chance = RollGui:WaitForChild('ChanceLabel')
RollingFrame.Visible = true
RollText.Visible = true
for i, Table in pairs(Auras) do
animateText(RollText, Chance, roll, Auras)
end
wait(1)
RollingFrame.Visible = false
RollText.Visible = false
end,
}
(the animation only says cyclone over and over)