Trying to get an NPC’s bodyparts to tween to a different color at the same time, need help because I’m having trouble on how to reference the color values to change them
tried pairs and ipairs, tried going for different methods like bodyparts[i].Color etc etc
local event = game:GetService("ReplicatedStorage"):WaitForChild("Trigger")
local object = script.Parent
local tween = game:GetService("TweenService")
local bodyparts = {object.LeftFoot, object.LeftHand, object.LeftLowerArm, object.LeftLowerLeg, object.LeftUpperArm, object.LeftUpperLeg,
object.LowerTorso, object.RightFoot, object.RightHand, object.RightLowerArm, object.RightLowerLeg, object.RightUpperArm, object.RightUpperLeg,
object.UpperTorso, object.Head
}
function changecolor(color)
object.Name = "NetFinch"
local goal = {Color = Color3.new(0.333333, 0, 0)}
for i,v in ipairs(bodyparts) do
tween:Create(bodyparts[i], TweenInfo.new(3), goal)
end
end
event.OnServerEvent:Connect(changecolor)
looks like I was jumping to conclusions too early and didn’t realize my latest change (bodyparts[i]) was actually proper and ended up confusing myself thinking the error report that didn’t pop up was a no error bug (I’ve had the same issue in the pas for other projects) that I needed a workaround for, thanks
for any new scripters learning tweenservice and is using this post for help/reuse on coding at any point, remember that creating a variable for the tween creation instead of the tweenservice (or in this case the variable called tween) is needed to play the tween itself