Can someone please help it's really annoying but this keeps happening... So I have created a script that generates a colour for the player's character then tweens the original colour to that colour... However I have another script that requires the colour of the character part to be the same Color3 value that was generated... I have made it so that it prints out the values for the original tween and after the tween and it is slightly different which sucks for the other script that detects if its the same color.
Here is my main colour randomizer code:
players.PlayerAdded:Connect(function(player)
wait(3)
local character = player.Character
local colour = GetColour()
while colour == nil do
colour = GetColour()
end
local Body = character:WaitForChild("Body")
local Head2 = character:WaitForChild("Head2")
local Back = character:WaitForChild("Back")
local LeftLeg = character:WaitForChild("Left Leg")
local RightLeg = character:WaitForChild("Right Leg")
local goal =
{
Color = Color3.new(colour.R, colour.G, colour.B)
}
print(colour)
--Create Transitions
local fade1 = tween:Create(Body, info, goal)
local fade2 = tween:Create(Head2, info, goal)
local fade3 = tween:Create(Back, info, goal)
local fade4 = tween:Create(LeftLeg, info, goal)
local fade5 = tween:Create(RightLeg, info, goal)
--Play Transitions
fade1:Play()
fade2:Play()
fade3:Play()
fade4:Play()
fade5:Play()
--Finalisation
wait(1)
print(Body.Color)
Head2:Destroy()
Body.Material = Enum.Material.SmoothPlastic
Back.Material = Enum.Material.SmoothPlastic
LeftLeg.Material = Enum.Material.SmoothPlastic
RightLeg.Material = Enum.Material.SmoothPlastic
end)
Then you have my Color3 match code:
local colour = button.Parent.Name
local colourNo = game:GetService("Players").LocalPlayer.Character.Body.Color
local colourNow
for i,v in pairs(RS.Colours:GetChildren()) do
for a,b in pairs(v:GetChildren()) do
if b.Name == "Value" then
-- If the colour3 value is the same as the current colour of body
if b.Value == colourNo then
print(b.Parent.Name)
colourNow = b.Parent
end
end
end
end
end
What it outputs:
0.419608, 0.184314, 0.737255
0.419608, 0.180392, 0.737255
As can be seen it has slightly different values which affects the whole script :/ And even if I adjust the script to make it so that after tweening it adjusts the Color to the generated color it still ends up with a different one:
0.941177, 0.490196, 0.0509804
0.941176, 0.490196, 0.0509804
0.941176, 0.490196, 0.0509804

1 comment
I have even tried Color3.fromRGB