Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why wont GetChildren Get ALL the Children?

Asked by
joeldes 201 Moderation Voter
7 years ago
Edited by BlueTaslem 7 years ago

Basically my issue is that the GetChildren function seems to only be grabbing just a few of the parts in the folder.

01print("Intalizing Eat Script")
02 
03local ReplicatedStorge = game:GetService("ReplicatedStorage")
04local eatEvent = game.ReplicatedStorage.EatEvent
05 
06local player = game.Players.LocalPlayer
07local character = player.Character
08 
09local stars = workspace.Food.Stars
10 
11local running = true
12local ticks = 1
13 
14if character:findFirstChild("Humanoid") then
15    local playerLocation = character.HumanoidRootPart.Position
View all 38 lines...
2
Why did you post a pastebin rather than using the site's Lua converter? PreciseLogic 271 — 7y
0
GetChildren() will return an array of ALL of the parent's children. I do not think it's the method that has the problem, rather how you're using it. My guess is some of the children do not follow your conditional. You can always print() to have a 'visual' of all the children. PreciseLogic 271 — 7y
0
Edited to replace pastebin link with code BlueTaslem 18071 — 7y

Answer this question