Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Script crashes roblox studio?

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

0

Put a wait() in the second repeat loop.

0

Ill try that

0

It works, post that as an answer and I'll accept it

1 answer

✓ Accepted answer

You just forgot your wait() on line 14. To fix the crashing issue just add a wait() into the 2nd repeat loop and it should not crash

This discussion is preserved as it was. New answers, comments, and votes are closed.