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

Why won't this text rotate once a player joins?

So I've tried to make a localscript which roates a TextLabel once a player joins. Here's the code.

game.Players.PlayerAdded:connect(function(player)
	while true do
	game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel.Rotation = 0
	wait(1)
	game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel.Rotation = 5
	wait(1)
	game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel.Rotation = -5
end
end)

Also the output is not showing any errors execpt a plugin error.

3 comments

0

Have you tried it in Server-Test-Mode, rather than the Studio-Test mode?

0

I'll try it now!

0

Still doesn't work.

1 answer

✓ Accepted answer

Assuming this is in the StarterGUI, it would be better to use,

game.Players.PlayerAdded:connect(function() --Player argument isn't needed
	while true do
		for i = 0, 5, 0.1 do --I switched to for loops for a nicer movement. =)
.			wait(0.1)
			script.Parent.ScreenGui.TextLabel.Rotation = i --Since this is in the StarterGui, and assuming that the ScreenGui is in the StarterGui as well, you don't need to do all that other stuff.
		end
		wait(1)
		for i = 5, -5, -0.1 do
			wait(0.1)
			script.Parent.ScreenGui.TextLabel.Rotation = i
		end
		wait(1)
		for i = -5, 0, 0.1 do
			wait(0.1)
			script.Parent.ScreenGui.TextLabel.Rotation = i
		end
	end
end)

Hope this helps!

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