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

Trying to get the children of a child? (Not sure if makes sense)

I'm trying to get a script that will get the children of a folder, then get the children of what's in that folder and set the Amount.Value = 999999999 in those folders, here's what I have so far.

while true do
for i,v in pairs(game.Workspace.Tycoon3.Storage:GetChildren()) do
v:GetChildren()do
v.Amount.Value = 999999999
wait(1)
end
end
end

1 answer

✓ Accepted answer

Find and check if the child exists, if so, set the value.

while true do
	for _, v in pairs(game.Workspace.Tycoon3.Storage:GetChildren()) do
		if v:FindFirstChild("Amount")
			v.Amount.Value = 999999999
			wait(1)
		end
	end
end

Also, with this while true do loop, you're doing the same thing over and over. If that's not what you're looking for, consider changing it. Hope this helped.

2 comments

0

Worked brilliantly, just had to put a "Then" on line 4, Thankyou.

0

No problem.

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