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

Infinite yield possible on 'Players.Note_23322:WaitForChild("StepsBonus")' can i fix this?

Asked by 3 years ago

I was doing my code until I saw this in the output bar:

Infinite yield possible on 'Players.Note_23322:WaitForChild("StepsBonus")'

I am trying to make GUI show up when i touch an orb here is the code also

local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local stepsBonus = player:WaitForChild("StepsBonus")

function createOrbGui ()

    if(player.StepsBonusCheck.Value ~= 0) then

        local text = Instance.new("TextLabel")
        text.Parent = playerGui.SpeedGUI
        text.Name = "BonusLabel"

        text.Position = UDim2.new(0.5, 0, .85, 0)
        text.TextSIze = 40
        text.TextColor3 = player.BCVCheck.Value.color

        text.Text = "+" .. player.StepsBonusCheck.Value .. " steps!"

        wait(5)
        player.StepsBonusCheck.Value = 0
        text:Destroy()




    end 


end

script.Parent.Parent.StepsBonusCheck.Changed:Connect(createOrbGui)

0
Basically Infinite yield possible on 'Players.Note_23322:WaitForChild("StepsBonus")', means that "StepsBonus" is not found. Try to recheck your spelling to see if that works. MarTieMak 56 — 3y
0
ok Note_23322 16 — 3y
0
thx a lot Note_23322 16 — 3y

Answer this question