I have been working on a backpack shop script here is my code: wait(1) while wait() do local Host = script.Parent.Parent.Parent.Parent.Parent.Parent local Player = game.Players:FindFirstChild(Host.Name) local Backpack = Player:WaitForChild("BackpackShop").BackpackV local mining = Player.leaderstats[Player:WaitForChild("BackpackShop").Mining.Value] script.Parent.Parent.Parent.SurfaceGui.TextLabel.Text = mining.Value.."/"..Backpack.Value if script.Parent.Parent.Parent.SurfaceGui.TextLabel.Text == script.Parent.Parent.Parent.CurrentOre.Value.."/"..script.Parent.Parent.Parent.MaxOre.Value then script.Parent.Parent.Parent.BrickColor = BrickColor.new("Really red") else script.Parent.Parent.Parent.BrickColor = BrickColor.new("Grey") end end
COMMUNITY QUESTION
attempt to index nil with 'WaitForChild' Fixable?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Please use a code block, it's the button with the lua thing above the text thing
In your mining variable, change WaitForChild to FindFirstChild