this is my failed attempt:
game.Players.PlayerAdded:Connect(function(player)
local GUI = player.PlayerGui:WaitForChild("ScreenGui")
local WelcomeString = "Welcome"
local Text = GUI:WaitForChild("TextLabel")
GUI.Enabled = true
local Counter = 0 --the for loop index
for i = 1, #WelcomeString + #player.Name do
Counter += 1
Text.Text = string.sub(WelcomeString, i, i)
if Counter > 1 then
Text.Text = string.sub(WelcomeString, 1, Counter)
end
if Counter > 7 then
Text.Text = string.sub(WelcomeString.." "..player.Name, 1, Counter + 1)
end
task.wait(0.05)
end
task.wait(2)
for i = 1, #WelcomeString + #player.Name do
Text.Text = string.sub(Text.Text, i, Counter - 1)
print(Text.Text)
task.wait(0.05)
end
end)```
** You are now Level 2! **