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

Why can I not detect object names in a loop?

while true do
	if game.Workspace.ttest.Name == "ttest" then
	print("im working")
	end
        wait(0.1) -- scripts break schedule is every 0.1 seconds 
end

You see, the if statement in this script works in any place of code, but when it is in a loop, nothing happens, why?

1 answer

✓ Accepted answer

Helped him solve the problem through discord this was the solution

while wait() do
if workspace:FindFirstChild("ttest") then
print("Im Running")
else print("Im not running")
end
end

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