Hello! I was wondering why this tween is not working with the Collection Service. I tried replacing stuff but it didn’t work.
Here is my script:
local tweenService = game:GetService("TweenService")
local function SimpleTween(Object, Length, Style, Direction, Properties)
local Tween = tweenService:Create(
Object,
TweenInfo.new(Length, Enum.EasingStyle[Style].Value, Enum.EasingDirection[Direction].Value),
Properties
)
Tween:Play()
Tween.Completed:Wait()
Tween:Destroy()
end
local CS = game:GetService("CollectionService")
local taggedParts = CS:GetTagged("Neon")
for _, texture in pairs(taggedParts) do
while true do
SimpleTween(texture, 1, "Linear", "Out", { Color = Color3.fromRGB(97, 144, 255) })
SimpleTween(texture, 1, "Linear", "Out", { Color = Color3.fromRGB(255, 84, 210) })
end
end
Oh just use spawn() since that runs the function and doesn’t yield the script
for _, texture in pairs(taggedParts) do
spawn(function()
while true do
SimpleTween(texture, 1, "Linear", "Out", { Color = Color3.fromRGB(97, 144, 255) })
SimpleTween(texture, 1, "Linear", "Out", { Color = Color3.fromRGB(255, 84, 210) })
end
end)
end