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

How do you save colors and load them?

Asked by 8 years ago

Recently, i tried using DataStore for saving my morphs, and since they mostly rely on colour, the player morphs into the model as it loads the colors onto the morph.

This is what i did.:

local DataStore = game:GetService("DataStoreService"):GetDataStore("NicuWolfSlot1")
local player = script.Parent.Parent


local Colors = {"Institutional white","Really black","Reddish brown","Dark stone grey","Dark orange","Black",
    "Brick yellow","Nougat","Cool yellow","Bright yellow","Pastel yellow",
    "Medium stone grey","Mid gray"
    }

local colorstosave = {
    player.Chest.Body.BrickColor,
player.Chest.Chest.BrickColor,
player.Chest.Neck.BrickColor,
player.Chest.Tail1.BrickColor,
}

local colorstore = colorstosave("Colors")

game.Players.PlayerRemoving:connect(function()
    local viewkey = "player-"..player.PlayerID
    local Savedstuff = DataStore:GetAsync(viewkey)


    if Savedstuff then
        for i = 1, #colorstosave do
            colorstore = Savedstuff[1]
            end
    else

        return
        end
end)

0
What is chest? Do you mean "Torso"? FiredDusk 1466 — 8y
0
No, Chest is a model within the Player CrammelApple 50 — 8y

Answer this question