TweenService:Create no property named 'Color' for object 'ThumbnailConfiguration'

I have no clue why it says it, heres my script

Debounce = true
TweenService = game:GetService("TweenService")
info = TweenInfo.new(0.1,Enum.EasingStyle.Linear)
goal = {}
goal.Color = Color3.fromRGB(159, 243, 233)


function onTouch(part) 
	local humanoid = part.Parent:FindFirstChild("Humanoid") 
	if Debounce then
	if (humanoid ~= nil) then
	if humanoid.Parent.Infected.Value == false then
				humanoid.Parent.Infected.Value = true
				humanoid.Parent.HumanoidRootPart.Anchored = true
				local anim = humanoid:LoadAnimation(script.Parent.Animation)
				anim:Play()
		Debounce = false
				wait(0.5)
				for _, child in ipairs(humanoid.Parent:GetChildren()) do
					if child.ClassName == "Accessory" then
				if child.Handle:FindFirstChild("Mesh") then
					child.Handle.Mesh.TextureId = ""
				end
				if child.Handle:FindFirstChild("SpecialMesh") then
				child.Handle.SpecialMesh.TextureId = ""
						end
						for i, child in pairs(child:GetChildren()) do
							hattween = TweenService:Create(child,info,goal) --this is where the problem is
						end
					end
					end
				
				local tween = TweenService:Create(humanoid.Parent.Torso,info,goal)
				local tween2 = TweenService:Create(humanoid.Parent["Left Arm"],info,goal)	
				local tween3 = TweenService:Create(humanoid.Parent["Right Arm"],info,goal)
				local tween4 = TweenService:Create(humanoid.Parent["Left Leg"],info,goal)	
				local tween5 = TweenService:Create(humanoid.Parent["Right Leg"],info,goal)
				local tween6 = TweenService:Create(humanoid.Parent.Head,info,goal)
				tween:Play()
				tween2:Play()
				tween3:Play()
				tween4:Play()
				tween5:Play()
				tween6:Play()
				hattween:Play()
				wait(0.45)
				Debounce = true
				humanoid.Parent.HumanoidRootPart.Anchored = false
		
	end
	end 
	end
	end

script.Parent.Touched:connect(onTouch)

2 comments

0

sorry that i make my scripting in the most hardest way possible

0

You're going through the components of an Accessory, which don't all contain 'Color' properties; make sure you know what you're iterating through.