I am trying to code stats into my game and it keeps giving me an error on nil value every time I attempt to run the game I believe the cause of this to be the W001 unknown global problem on my WaitForChild.
local plr = game:GetService("Players").LocalPlayer
function update()
local Stats = game:GetService("ReplicatedStorage")WaitForChild("Stats")WaitForChild(plr.Name)
for i,v in pairs(script.Parent.Stats:GetChildren()) do
v.Text = Stats:FindFirstChild(v.Name).Value
end
end
while wait(1) do
update()
end
is the code

1 comment
thankyou