This is my current script, and for some reason it is not working.
function TimerEnd() wait(30) Check = game.Players:GetChildren() for i=1,#Check do BKP = Check[i].Backpack:GetChildren() ------Indexes the backpack of the player[i]'s... for i=1,#BKP do ------------Now it has their backpack from 1-ALL players... if Check[i].BKP[i].BeginnerSword == nil then -----If a player doesn't have the beginner tool then... A.Text = ..Check[i]..."He's got none." -----Say in public he has none and announce his name.(**All players** that do not have that tool.) end end end end
What's wrong?
You have a for loop within a for loop, and they both use the same variable (i). This confuses the script. Try changing one of the variables.
Edit: I couldn't get your code to work. Try this:
function TimerEnd() wait(30) local Check = game.Players:GetChildren() for _,v in pairs(Check) do local found local BKP = v.Backpack:GetChildren() for __,x in pairs(BKP) do if x.Name == "BeginnerSword" then found = true end end if found == true then A.Text = v.Name.." has got none." end end end