Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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!

1
Better solution would be to use propertychangedsignal in order to take as less as possible memory instead of while loop. karlo_tr10 1233 — 4y
0
thanks DeadStroke509 3 — 4y
Ad

Answer this question