Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Skin tone not saving when resetted?

Tsave.OnServerEvent:connect(function(plr,tone)
    plr.CharacterAdded:connect(function(char)
        wait(3)
        local bodycolors = char:FindFirstChild("Body Colors")
    if bodycolors then
        bodycolors:Destroy()
    end
    
    for i,limbs in pairs (char:GetChildren())do
        if limbs:IsA("Part") then
            limbs.BrickColor = BrickColor.new(Color3.new(tone))
            end
    end
    
    end)
end)

Basically. A player selects a skin tone, and then recieves it. When he/she dies i want this to run. so i make it run yes? but the skin tone doesnt work and just returns as the normal skin tone for the plr. (Keep in mind the body colors are automatically deleted). The tone is a rgb color e.g 255,255,255

1 answer

 local  function onCharacterAdded(character)
-- Place the skin color script here.
  end

  local  function onCharacterRemoving(character)
		 -- Place the skin color script here.
  end

 local  function onPlayerAdded(player)
  PLAYERNAME.CharacterAdded:Connect(onCharacterAdded)
  PLAYERNAME.CharacterRemoving:Connect(onCharacterRemoving)
  end

Replace PLAYERNAME with the function or the player's name. When the player is removed, it will load the skin color script. (I suggest putting a wait(6) in front of the despawn function.)

This discussion is preserved as it was. New answers, comments, and votes are closed.