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

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

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 :)

3 comments

0

Try using Saveslot1:SetAsync instead of skincolorG:SetAsync on line 10

0

Are u trying to save skincolorG?

0

You can save a object you can only save values. so use Saveslot1:SetAsync(player.UserId, skincolorG.Value) at line 10 instead.

1 answer

Okay it's fixed now. Thanks mattscy :)

1 comment

0

and Spiik3yViinH

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