So im quite new to scripting and I just got the part of FindFirstChild and I'm attempting to make a stat that combines all the numbers of the other 3 stats Blue,Red and White but it gives the error in the title can someone help?And if there is another way of achieving what I want I would like to know.Here is my code:
while wait() do local player = game.Players.LocalPlayer local estats = player:FindFirstChild("stats") local white estats:FindFirstChild("White") local red = estats:FindFirstChild("Red") local blue = estats:FindFirstChild("Blue") local all = estats:FindFirstChild("All") all.Value = blue.Value + red.Value + white.Value end
oh wait i think i see the problem, you forgot an equal sign i think in line 4 it says
local white estats:FindFirstChild("White")
it should be
local white = estats:FindFirstChild("White")
so i guess try this
wait()--i always do this at the start of code or making variables local player = game.Players.LocalPlayer local estats = player:FindFirstChild("stats") local white = estats:FindFirstChild("White") local red = estats:FindFirstChild("Red") local blue = estats:FindFirstChild("Blue") local all = estats:FindFirstChild("All") while true do wait() all.Value = blue.Value + red.Value + white.Value end
i hope this helps :3