Hello, I am making a ‘Slow’ debuff in my game which slows enemies down and makes them be more blue, so far I have this script but it is completely useless as it just colours the enemies head and doesn’t do anything else.
The enemies do not have a BodyColors value.
Here is an overview of what I want to achieve:
Enemy gets stabbed
They turn more blue (or one colour)
And then they turn back to their original colours.
for _, bodyPart in character:GetChildren() do -- Loop through character's children
if bodyPart:IsA("BasePart") then -- Check if it is a body part
coroutine.wrap(function() -- This is very important to wrap it because if you dont wrap it, it will do each limb seperately
local lastColor = bodyPart.Color -- Save the color before it was set
if bodyPart.Name == "Torso" then
bodyPart.Color = Color3.fromRGB(170,170,255) -- Set color to light blue
elseif bodyPart.Name == "Left Arm" then
-- Set the color to something different, then do an elseif for each body part (Head,Torso,Left Arm,Right Arm,Left Leg,Right Leg)
end
task.wait(.5) -- Wait 0.5 seconds
bodyPart.Color = lastColor -- Set it back to normal
end)() -- The "()" is also very important as it will call the function
end
end