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

'SetAsync is not a valid member of IntValue'. Can Somebody Help ?

Asked by 6 years ago
Edited 6 years ago

Hello

I Am Making A Custom Character Save System And I Get This Error

SetAsync is not a valid member of IntValue

Here is the code (Shortened, full version is not complete)

local CCDS1 = game:GetService("DataStoreService")
local Saveslot1 = CCDS1:GetDataStore("CCData1")

game.Players.PlayerAdded:connect(function(player)
    local slot1 = Instance.new("Folder",player)
    slot1.Name = "CustomCharacterSlotOne"
    local skincolorG = Instance.new("IntValue",slot1)
    skincolorG.Name = "SkinColorGREEN"
    skincolorG.Value = Saveslot1:GetAsync(player.UserId) or 0
    skincolorG:SetAsync(player.UserId, skincolorG.Value)
    skincolorG.Changed:connect(function()
        Saveslot1:SetAsync(player.UserId, skincolorG.Value)
        print("skincolorG saved !")
    end)
end)

Can You Tell Me Why Is This Not Working ?

Edit : Solved ! Thanks mattscy :)

0
Try using Saveslot1:SetAsync instead of skincolorG:SetAsync on line 10 mattscy 3725 — 6y
0
Are u trying to save skincolorG? NovusDev 25 — 6y
0
You can save a object you can only save values. so use Saveslot1:SetAsync(player.UserId, skincolorG.Value) at line 10 instead. NovusDev 25 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Okay it's fixed now. Thanks mattscy :)

0
and Spiik3yViinH EliElixer -6 — 6y
Ad

Answer this question