Hello Developers
So i’ve been testing my game and when the round ends it will tween the leaderboard. But what happens is, at last 2 seconds. it tweened the leaderboard instantly. I’ve been having this problem for a while and try anything i could try to make it tween at the perfect time but sadly it wont work.
print(MaxTime-(((MaxTime/3)-10)*3))
task.wait(MaxTime-(((MaxTime/3)-10)*3))
stats[drawer] = {Points/(CountTable()),CountTable()}
for _, plyrsAvail in pairs(game.Players:GetPlayers()) do
plyrsAvail:WaitForChild('PlayerGui'):WaitForChild('GameUi(wdoj21nd9nd)').Leaderboard:TweenPosition(UDim2.new(0,0,0,0),'Out','Back',1)
for _, user in pairs(game.Players:GetPlayers()) do
if stats[user.Name] then
local scoresloading = game.ReplicatedStorage["scoretemplate(882dj8whdd)"]:Clone()
scoresloading.Parent = plyrsAvail:WaitForChild('PlayerGui'):WaitForChild('GameUi(wdoj21nd9nd)').Leaderboard.List
scoresloading.username.Text = user.Name
scoresloading.scorechanges.Text = stats[user.Name][1]
scoresloading.LayoutOrder = stats[user.Name][2]
else
local scoresloading = game.ReplicatedStorage["scoretemplate(882dj8whdd)"]:Clone()
scoresloading.Parent = plyrsAvail:WaitForChild('PlayerGui'):WaitForChild('GameUi(wdoj21nd9nd)').Leaderboard.List
scoresloading.username.Text = user.Name
scoresloading.scorechanges.Text = '0'
scoresloading.scorechanges.TextColor3 = Color3.fromRGB(255, 0, 0)
scoresloading.LayoutOrder = 50
end
end
end
it didn’t work sadly i assume there was problem with the math. in task.wait(MaxTime-(((MaxTime/3)-10)*3)). it still played at 2 seconds. Variable MaxTime is 120
local function EndRound()
stats[drawer] = {Points/(CountTable()),CountTable()}
for _, plyrsAvail in pairs(game.Players:GetPlayers()) do
plyrsAvail:WaitForChild('PlayerGui'):WaitForChild('GameUi(wdoj21nd9nd)').Leaderboard:TweenPosition(UDim2.new(0,0,0,0),'Out','Back',1)
for _, user in pairs(game.Players:GetPlayers()) do
if stats[user.Name] then
local scoresloading = game.ReplicatedStorage["scoretemplate(882dj8whdd)"]:Clone()
scoresloading.Parent = plyrsAvail:WaitForChild('PlayerGui'):WaitForChild('GameUi(wdoj21nd9nd)').Leaderboard.List
scoresloading.username.Text = user.Name
scoresloading.scorechanges.Text = stats[user.Name][1]
scoresloading.LayoutOrder = stats[user.Name][2]
else
local scoresloading = game.ReplicatedStorage["scoretemplate(882dj8whdd)"]:Clone()
scoresloading.Parent = plyrsAvail:WaitForChild('PlayerGui'):WaitForChild('GameUi(wdoj21nd9nd)').Leaderboard.List
scoresloading.username.Text = user.Name
scoresloading.scorechanges.Text = '0'
scoresloading.scorechanges.TextColor3 = Color3.fromRGB(255, 0, 0)
scoresloading.LayoutOrder = 50
end
end
end
wait(5)
for _, plyrsAvail in pairs(game.Players:GetPlayers()) do
plyrsAvail:WaitForChild('PlayerGui'):WaitForChild('GameUi(wdoj21nd9nd)').Leaderboard:TweenPosition(UDim2.new(0,0,-1,0),'In','Back',1)
end
wait(1)
for _, plyrsAvail in pairs(game.Players:GetPlayers()) do
for _, listed in pairs(plyrsAvail:WaitForChild('PlayerGui'):WaitForChild('GameUi(wdoj21nd9nd)').Leaderboard.List:GetChildren()) do
if listed:IsA('Frame') then
listed:Destroy()
end
end
end
NewRound()
end
at here stats[drawer] it will be hard because that’s a table and the stats will be recorded using my chat function. so if i separate it it might cost a lots of work to connect the 2 or more function. I’ll try the second idea, hang on
TweenInfo should not fail, I think your waits/delays are Incorrect
Please try It with different waits/delays If it works please mark my post as the solution