Error in the script

I encountered a problem that this folder could not be found in the player, but at first everything worked, I don’t know why it stopped working.

local plr = game.Players.LocalPlayer
local textSlots = script.Parent
local folder = plr:WaitForChild("BankFolder")
local slots = folder:WaitForChild("CarsSlots")

while wait(0.05) do
	textSlots.Text = "Slots: "..slots.Value.."/5"
end

The folder exists in the player but it gives the following error:
Infinite yield possible on ‘Players.arsen2424657:WaitForChild(“BankFolder”)’

2 Likes

My only advice here would be to make sure the folder is named exactly like you wrote in the script and parented right. The problem is that the script cannot find “BankFolder” inside of the player and just waits for all eternity

2024-03-01
Yes, it is present in the player and has exactly the same name

Does the script work even tho you got the warning?

It turns out that this error was a lie and the script worked and continues to work

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.