Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Skin tone not saving when resetted?

Asked by 5 years ago

```lua 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

Log in to vote
0
Answered by
KDarren12 705 Donator Moderation Voter
5 years ago
 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.)

Ad

Answer this question