Hello! I am tweening this countdown frame to certain positions and sizes. (Size is {0.418, 0},{0.433, 0} Position is {0.291, 0},{0.284, 0}) For some reason it keeps moving off the screen instead.
Here is the starting size and position:
Starting Size is {0.052, 0},{0.036, 0}
Starting Position is {0.472, 0},{0.443, 0}
Here is the script:
for i = 3,0,-1 do
local CountDown = i
for _, Player in pairs(game.Players:GetChildren()) do
WaitForGuiLoads(Player)
print(CountDown)
Player.PlayerGui.MainGui.MainFrame.InGameFrame.CountDownFrame.Size = UDim2.new({0.052, 0},{0.036, 0})
Player.PlayerGui.MainGui.MainFrame.InGameFrame.CountDownFrame.Position = UDim2.new({0.472, 0},{0.443, 0})
Player.PlayerGui.MainGui.MainFrame.InGameFrame.CountDownFrame.Countdown.TextTransparency = 0
if CountDown > 0 then
Player.PlayerGui.MainGui.MainFrame.InGameFrame.CountDownFrame:TweenSize(UDim2.new({0.418, 0},{0.433, 0}), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 1)
Player.PlayerGui.MainGui.MainFrame.InGameFrame.CountDownFrame:TweenPosition(UDim2.new({0.291, 0},{0.284, 0}), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 1)
Player.PlayerGui.MainGui.MainFrame.InGameFrame.CountDownFrame.Countdown.Text = CountDown
elseif CountDown < 1 then
Player.PlayerGui.MainGui.MainFrame.InGameFrame.CountDownFrame:TweenSize(UDim2.new({0.471, 0},{0.543, 0}), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 1)
Player.PlayerGui.MainGui.MainFrame.InGameFrame.CountDownFrame:TweenPosition(UDim2.new({0.256, 0},{0.189, 0}), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 1)
Player.PlayerGui.MainGui.MainFrame.InGameFrame.CountDownFrame.Countdown.Text = "GO!"
game.Workspace.AllStages[CurrentStage].Start.CanCollide = false
GameCountDown()
wait(1)
Player.PlayerGui.MainGui.MainFrame.InGameFrame.CountDownFrame.Countdown.TextTransparency = 0
end
end
wait(1)
end
Thanks