So I have this script that should make a GUI come down and say that a player has joined, then goes back up after 3 seconds, it comes down, waits the 3 seconds, and then crashes, I've tried it 3 times now, and all times it has crashed, please help!
game.Players.PlayerAdded:connect(function(player)
local text = player.PlayerGui:WaitForChild("PlayerJoined").TextLabel
local posy = text.AbsolutePosition.Y
repeat
text.Text = player.Name.." has joined the game!"
posy = posy + 1
text.Position = UDim2.new(0.4,0, 0, posy)
wait(0.035)
until
text.AbsolutePosition.Y == (0)
wait(3)
repeat
posy = posy - 1
until
text.AbsolutePosition.Y == (-100)
text.Text = " "
end)
There is nothing in the console about this script, so please help!

3 comments
Put a wait() in the second repeat loop.
Ill try that
It works, post that as an answer and I'll accept it