Hey devs, im trying to make an ability where you switch body part colors, on the press of a button. the whole system for keybinds works its just i dont know how to store a body part color in a table to then use it in the tweening back. if i set it to a color in the script, it will save over and over until it stops at the last bodypart in the character. any help is appreciated on how to do this
local oldcol = {}
local function auraE1on()
local char = script.Parent.Parent
local humrp = char.HumanoidRootPart
local player = game.Players:GetPlayerFromCharacter(char)
local evolvedauratype = player.Aura.Value
for i,v in pairs(char:GetChildren()) do
if v:IsA("BasePart") and v.Name ~= humrp.Name then
--store old bodypart color
local tween = ts:Create(v, TweenInfo.new(0.75), {Color = Color3.fromRGB(0,0,0)})
tween:Play()
local particle = script.EvolvedAuras:WaitForChild(evolvedauratype.."Aura"):Clone()
particle.Parent = v
particle.Enabled = true
end
end
end
local function auraE1off()
local char = script.Parent.Parent
local humrp = char.HumanoidRootPart
local player = game.Players:GetPlayerFromCharacter(char)
for i,v in pairs(char:GetChildren()) do
if v:IsA("BasePart") and v.Name ~= humrp.Name then
local tween = ts:Create() --tween to old bodypart color
local particle = v:FindFirstChildOfClass("ParticleEmitter")
local keyword = "Aura"
local name = particle.Name
if name:match(keyword) then
particle.Enabled = false
coroutine.wrap(function()
wait(1.4)
particle:Destroy()
end)()
end
end
end
end