Works in studio, but not in player. This is a script in ServerScriptService
game.Players.PlayerAdded:connect(function(player)
local text = player.PlayerGui:WaitForChild("PlayerJoined").TextLabel
repeat
text.Text = player.Name.." has joined the game!"
local posy = text.AbsolutePosition.Y
posy = posy + 1
text.Position = UDim2.new(0.4,0, 0, posy)
wait(0.015)
until
text.AbsolutePosition.Y == (0)
wait(3)
repeat
local posy = text.AbsolutePosition.Y
posy = posy - 1
text.Position = UDim2.new(0.4,0, 0, posy)
wait(0.015)
until
text.AbsolutePosition.Y == (-100)
text.Text = " "
end)

2 comments
Additional notes of this script: FilteringEnabled is enabled. Script is inside a Server Script.
How about trying to put an if statement on the very top(in the function) which goes something like this.... if player then