What do you want to achieve?
To tween all the parts.
What is the issue?
Its only tweening one random part.
What solutions have you tried so far?
I tried doing something different but still didn’t work.
This is my script :strong text
local CollectionService = game:GetService("CollectionService")
local TweenService = game:GetService("TweenService")
local Replica = game:GetService("ReplicatedStorage")
for i, model in pairs(CollectionService:GetTagged("Stars")) do
print(model)
local TweeningInformation = TweenInfo.new(
2,
Enum.EasingStyle.Quad,
Enum.EasingDirection.Out,
0,
true,
0
)
local PartProperties = {
Color = Color3.fromRGB(170, 0, 255)
}
local Tween = TweenService:Create(model,TweeningInformation,PartProperties)
while wait(10) do
Tween:Play()
print("Done")
end
end
This makes the code yield forever and not run stuff after it. Try this
local CollectionService = game:GetService("CollectionService")
local TweenService = game:GetService("TweenService")
local Replica = game:GetService("ReplicatedStorage")
local TweenTable = {}
local TweeningInformation = TweenInfo.new(
2,
Enum.EasingStyle.Quad,
Enum.EasingDirection.Out,
0,
true,
0
)
local PartProperties = {
Color = Color3.fromRGB(170, 0, 255)
}
for i, model in pairs(CollectionService:GetTagged("Stars")) do
print(model)
local Tween = TweenService:Create(model,TweeningInformation,PartProperties)
table.insert(TweenTable, Tween)
end
while wait(10) do
for i,Tween in pairs(TweenTable) do
Tween:Play()
end
print("Done")
end
Can you send a file of all the objects that need to change color? If you can’t, send an image of the explorer of the objects and/or what it looks like?
It must be the models, the script works completely fine
I had the same problem and I fixed it with Coroutines and heres a fragment of my code for it
For some reason Collection Service seems to picks the first one out of the selected parts and executes that and it doesn’t seem to continue down the list until the first one has finished its code
for _,Spinny in pairs(Spinny) do
local co = coroutine.wrap(function()
while task.wait() do
Spinny.CFrame = Spinny.CFrame * CFrame.Angles(0,speed,0)
end
end)
co()
end