Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Values and #?

while true do
	wait(1)
	local TooYoung=game.Workspace.TooYoung:GetChildren()
	script.Parent.TooYoungHowMuch.Value=#game.Workspace.TooYoung:GetChildren()
end

Objects are being added to "TooYoung" in another script but the value is not being changed.

1 answer

Or were you trying to get how many items were too young?

local count = 0

local tooyoung = game.Workspace.TooYoung:GetChildren()
for i = 1, #tooyoung do
	print("Counting child number " .. count .. ".")
	count = count + 1
end
print("The amount of children that were too young equaled " .. count .. ".")
script.Parent.TooYoungHowMuch.Value = count

4 comments

0

whats the [i].Name thing do

0

It checks each child object and gets it's name.

0

no this is a number value I want the amount of children in too young

0

I edited.

This discussion is preserved as it was. New answers, comments, and votes are closed.