Why wont GetChildren Get ALL the Children?
Basically my issue is that the GetChildren function seems to only be grabbing just a few of the parts in the folder.
01 | print ( "Intalizing Eat Script" ) |
03 | local ReplicatedStorge = game:GetService( "ReplicatedStorage" ) |
04 | local eatEvent = game.ReplicatedStorage.EatEvent |
06 | local player = game.Players.LocalPlayer |
07 | local character = player.Character |
09 | local stars = workspace.Food.Stars |
14 | if character:findFirstChild( "Humanoid" ) then |
15 | local playerLocation = character.HumanoidRootPart.Position |
20 | local stars = workspace.Food.Stars:GetChildren() |
23 | for i,Part in pairs (stars) do |
24 | local magnitude = (playerLocation - Part.Position).magnitude |
26 | if magnitude < = 300 then |
27 | print (Part.Name, " - " ,magnitude) |
28 | eatEvent:FireServer(Part) |