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

Roblox how do can i loopcheck if a textbox = a players name?

When im trying to make a if textbox = a players name it all works fine. But only once. How can i loop it to go multiple times over and over my localscript would be

if script.Parent.Frame.PlayersTrollFrame.TextBox == game.Players.LocalPlayer.Name then print("yes") else print("no") end end) how can i make that small part of a script run over and over?

1 answer

✓ Accepted answer

Here's a simple way to make a forever loop;

while wait()do
	if script.Parent.Frame.PlayersTrollFrame.TextBox.Text == game.Players.LocalPlayer.Name then
	print("yes")
else
	print("no')
	end
end

You forgot to get the text in the script you posted. Hopefully this helps!

2 comments

1

Better solution would be to use propertychangedsignal in order to take as less as possible memory instead of while loop.

0

thanks

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