Are you trying to tween all of the flowers?
This would be better with loops. With this loop, you can iterate through all children inside of a folder, like so:
for index, child in pairs(workspace.MyFlowers:GetChildren()) do
print(child.Name)
end
this prints every single child’s name inside of the workspace.MyFlowers
folder.
the GetChildren()
function returns a table with all the children of the instance you give it, and the loop runs through all of them individually.
you can use a table to store all of the tweeninfos you want. like so:
local infos = {
Info1 = TweenInfo.new(); -- change to your liking
Info2 = TweenInfo.new(); -- remember the ; though
Info3 = TweenInfo.new(); -- etc etc
}
you can do the same with the tween goals
local goals = {
Goal1 = {Transparency = 1}; -- change to your liking
Goal2 = {CanCollide = false}; -- remember the ;
Goal3 = {Color = Color3.fromRGB(255, 255, 255)}; -- etc etc
}
Now its time to loop through all the parts and apply the tween to them.
We’ll use the for loop again and loop through the parts in your folder.
for _, part in pairs(workspace.MyFlowers:GetChildren()) do -- loop through all the children
-- now we are going to loop through all of the info and goals
for _, info in pairs(infos) do
-- this will loop through all of the infos we have
-- bare with me there are a lot of loops
for _, goal in pairs(goals) do
-- now we have looped thorough all of the assets
tweenService:Create(part, info, goal)
-- this tweens each part with each info and goal
end
end
end
Now I’m not sure if this is what you wanted but I hope it helps. There is probably a better way to do this but idk. Feel free to ask any other questions if you need
Bassically, you give the loop at list of items and it will run individually for each item in the list which you can change properties for all of them.
local items = {
"Test1";
"Test2";
"Test3"; -- always remember the ; though (you dont need it on the last one)
}
-- you can name index or item whatever you want, but item is the most important
for index, item in pairs(items) do
print(item)
-- this will print Test1 and then Test2 and then Test3 etc etc
-- then you can change each item for example
item = 1 -- this makes every item in the list = to 1
end
You can check out more about loops here