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

What is it warning "infinite yield possible on"?

Asked by 5 years ago
Edited 5 years ago

hello all! What this is warning problem? -- https://imgur.com/a/W5DUNvO

buyUpdate:

01local player = game.Players.LocalPlayer
02while true do
03    wait(.1)
04                if script.Parent.Parent.Parent:WaitForChild("Value"):WaitForChild("SwordBoost1") then
05                local v = script.Parent.Parent.Parent:WaitForChild("Value"):WaitForChild("SwordBoost1")
06                if player.Tools[script.Parent.Parent.Parent:WaitForChild("Value"):WaitForChild("SwordBoost1").SwordBoostParent.Value].Value == true then
07                    if player.ToolEquiped.Value == script.Parent.Parent.Parent:WaitForChild("Value"):WaitForChild("SwordBoost1").SwordBoostParent.Value then
08                    local toolTemplate = script.Parent.Parent.Parent:WaitForChild("Value"):WaitForChild("SwordBoost1")
09                    local sel = toolTemplate:WaitForChild("Sel")
10                    sel:WaitForChild("Stats").Text = "Equipped"     
11                    else
12                    local toolTemplate = script.Parent.Parent.Parent:WaitForChild("Value"):WaitForChild("SwordBoost1")
13                    local sel = toolTemplate:WaitForChild("Sel")
14                    sel:WaitForChild("Stats").Text = "Equip"                   
15                 end
16            end
17     end
18end

SeeStats:

01script.Parent.MouseButton1Click:Connect(function()
02    if script.Parent.Parent.Parent.Parent.Parent.Value:FindFirstChild("SwordBoost1") then
03        local st = script.Parent.Parent.Parent.Parent.Parent.Value.SwordBoost1.SwordBoostParent
04        script.Parent.Parent.Parent.Parent.Parent.Value.SwordBoost1.Visible = false
05        script.Parent.Parent.Parent.Parent.Parent.Value.SwordBoost1.Parent = script.Parent.Parent.Parent[st.Value]
06        local valueFrame = script.Parent.Parent.SwordBoost1
07        valueFrame.Parent =  script.Parent.Parent.Parent.Parent.Parent:WaitForChild("Value")
08        valueFrame.Visible = true
09    else
10        local valueFrame = script.Parent.Parent.SwordBoost1
11        valueFrame.Parent =  script.Parent.Parent.Parent.Parent.Parent:WaitForChild("Value")
12        valueFrame.Visible = true
13    end
14    end)

Where is problem warning or no have? A have to need fix problem warning? :)

1 answer

Log in to vote
1
Answered by 5 years ago

"Infinite yield possible on" means that a WaitForChild() function has been waiting for a child for too long, and that it could possibly be waiting for that child forever potentially causing lag. That can happen because the child either took too long to appear/load on the desired place or the child doesn't exist.

Example:

1workspace:WaitForChild("Part") --//Waits for a child named part

It will wait for a child named "Part" to appear, but if it takes too long for the child to appear on workspace or the child doesn't exist then you will get the "Infinite yield possible on" warning.

0
Got another interesting question: what is the difference between script.Parent is long? Pavel1012345 11 — 5y
Ad

Answer this question