You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
make the parts tween color smoothly -
What is the issue? Include screenshots / videos if possible!
it just goes black not smoothly
local function CreateDebris(color: Color3)
local character = player.Character
if not character then return end
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
local RandomDirection
repeat
RandomDirection = Vector3.new(math.random(-100, 100), math.random(-100, 100), math.random(-100, 100)).Unit
until RandomDirection.Magnitude > 0.1
local RandomRotation = CFrame.Angles(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360)))
local RandomSize = math.random(DebrisMinSize, DebrisMaxSize)
local Debris = script.Debris:Clone()
Debris.Parent = workspace
Debris.CFrame = humanoidRootPart.CFrame * CFrame.new(RandomDirection * math.random(DebrisMinDistance, DebrisMaxDistance)) * RandomRotation
Debris.Size = Vector3.new(RandomSize, RandomSize, RandomSize)
Debris.Color = color
local Goal = Color3.new(color.R * 0.5, color.G * 0.5, color.B * 0.5)
TweenService:Create(Debris, TweenInfo.new(5), {Color = Goal}):Play()
DebrisService:AddItem(Debris, 5)
end
local function GreenColor()
if SpinningPart then
SpinningPart:FindFirstChild("Green").Color = Color3.fromRGB(0, 200, 0)
TweenService:Create(SpinningPart:FindFirstChild("Green"), TweenInfo.new(5), {Color = Color3.fromRGB(0, 100, 0)}):Play()
EnableParticle(Color3.fromRGB(0, 200, 0))
for i = 1, DebrisCount do
CreateDebris(Color3.fromRGB(0, 150, 0))
end
end
end
local function YellowColor()
if SpinningPart then
SpinningPart:FindFirstChild("Yellow").Color = Color3.fromRGB(200, 200, 0)
TweenService:Create(SpinningPart:FindFirstChild("Yellow"), TweenInfo.new(5), {Color = Color3.fromRGB(100, 100, 0)}):Play()
EnableParticle(Color3.fromRGB(200, 200, 0))
for i = 1, DebrisCount do
CreateDebris(Color3.fromRGB(150, 150, 0))
end
end
end
local function RedColor()
if SpinningPart then
SpinningPart:FindFirstChild("Red").Color = Color3.fromRGB(200, 0, 0)
TweenService:Create(SpinningPart:FindFirstChild("Red"), TweenInfo.new(5), {Color = Color3.fromRGB(100, 0, 0)}):Play()
EnableParticle(Color3.fromRGB(200, 0, 0))
for i = 1, DebrisCount do
CreateDebris(Color3.fromRGB(150, 0, 0))
end
end
end
local function BlueColor()
if SpinningPart then
SpinningPart:FindFirstChild("Blue").Color = Color3.fromRGB(0, 0, 200)
TweenService:Create(SpinningPart:FindFirstChild("Blue"), TweenInfo.new(5), {Color = Color3.fromRGB(0, 0, 100)}):Play()
EnableParticle(Color3.fromRGB(0, 0, 200))
for i = 1, DebrisCount do
CreateDebris(Color3.fromRGB(0, 0, 150))
end
end
end
in the video it is yellow and supposed to fade out to black but it is not smooth