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

Why is it saying I can't save a nil value?

For some reason I can not save or retrieve data in my script.

Here it is:

if marketS:UserOwnsGamePassAsync(Player.UserId,7110587) then 
	local GangStats = GangStats:GetAsync(70)
	local LowestGangId = GangStats.LowestGangId
	local NewId = LowestGangId + 1 
	local DataToSave = 
	{
		LowestGangId = NewId
	}
	GangStats:SetAsync(70,DataToSave)
	Player.GangStats.GangRank.Value = "Leader"
	Player.GangStats.GangId.Value = NewId
	local DataToSave2 = 
	{
		GangId = NewId,
		OwnerId = Player.UserId,
		Members = 1
	}
	GangStore:SetAsync(NewId,DataToSave2)
	addGang(NewId,Description)
end

For whatever reason, it is saying I am calling a nil value where it says GangStats:SetAsync(70,DataToSave)

1 answer

Go check every value or something by printing to check if something is actually nil

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