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

Values and #?

Asked by 7 years ago
Edited 7 years ago
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

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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
0
whats the [i].Name thing do shabbs15 67 — 7y
0
It checks each child object and gets it's name. Stormersoul 0 — 7y
0
no this is a number value I want the amount of children in too young shabbs15 67 — 7y
0
I edited. Stormersoul 0 — 7y
Ad

Answer this question