im trying to script a color changing part with tween service using math.random but the issue its only tweening any 2 same colors repeatedly, i want it to tween random colors everytime any fixes?
local part = script.Parent
local TweeningInformation = TweenInfo.new(
0.5,
Enum.EasingStyle.Quad,
Enum.EasingDirection.Out,
753475938457843579348573,
true,
0
)
local PartProperties = {
Color = Color3.fromRGB(math.random (0,255), math.random (0,255), math.random (0,255) )
}
local Tween = TweenService:Create(part,TweeningInformation,PartProperties)
Tween:Play()
while wait(.5) do
local Tween = TweenService:Create(part,TweeningInformation, {Color = Color3.fromRGB(math.random (0,255), math.random (0,255), math.random (0,255))})
Tween:Play()
end
local ts = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(1) --speed
local part = script.Parent
local tween, randomColor
while true do
randomColor = Color3.fromRGB(
math.random(0, 255), math.random(0, 255), math.random(0, 255))
tween = ts:Create(part, tweenInfo, {Color = randomColor})
tween:Play() tween.Completed:Wait()
end