I have this set of code here. It works all the way until this part:
for i,v in pairs(mouse.Target:GetDescendants()) do
I want to know how I can replace this with a semi-infinite loop that checks until a certain outcome is made. Heres the full code:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local mouses = {
"http://www.roblox.com/asset/?id=409468479"
}
local rs = game:GetService("RunService")
local ObjectInfo = script.Parent:WaitForChild("ObjectInfo")
local TextInfo = ObjectInfo:WaitForChild("TextLabel")
local debounce = true
--
mouse.Icon = mouses[1]
--
rs.RenderStepped:Connect(function()
if debounce then
if mouse.Target ~= nil then
if mouse.Target:FindFirstChild("NameLabel") then
debounce = false
local Start = UDim2.new(0.422, 0,1, 0)
local Goal = UDim2.new(0.422, 0,0.874, 0)
TextInfo.Text = mouse.Target.NameLabel.Value
TextInfo.Position = Start
local tween = TextInfo:TweenPosition(
Goal,
Enum.EasingDirection.InOut,
Enum.EasingStyle.Quad,
1,
true
)
wait(1)
for i, v in pairs(mouse.Target:GetDescendants()) do
print(v)
if v.Name ~= "NameLabel" then
TextInfo.Position = Goal
local tween = TextInfo:TweenPosition(
Start,
Enum.EasingDirection.InOut,
Enum.EasingStyle.Quad,
1,
true
)
wait(1)
print("true")
debounce = true
else
print("false")
debounce = false
end
end
end
else
TextInfo.Text = ""
end
end
wait()
end)
Hopefully you guys can help and maybe find a few other errors I might of not seen.

5 comments
What are you trying to achieve here? Tweeting a UI if the mouse is over it?
*Tweening
And what exactly is your error?
The code checks if the mouses target part has a NameValue in it, then tweens some text up displaying the NameValues's string. The part that
is having the issue is that the for i,v in pairs do part only checks once, so it gets softlocked and the text stays where it is. I need the checker to loop infinitely until the mouse leaves the part with the value.