DataStore Issues

Ive got a issuse with my datastore, it aint datastoring even tho it… shoud!

heres the script, theres no errors but it doesnt save.

local DataStore = game:GetService("DataStoreService")
local Data = {
	
	Campain1 = false;
	Campain2 = false;
	Campain3 = false;
	Campain4 = false;
	Campain5 = false;
	Campain6 = false;
	Campain7 = false;
	Campain8 = false;
	
}
local DefaultData = {

	Campain1 = true;
	Campain2 = false;
	Campain3 = false;
	Campain4 = false;
	Campain5 = false;
	Campain6 = false;
	Campain7 = false;
	Campain8 = false;

}
local DataMainStore = DataStore:GetDataStore("PlayerDataTest2")

game.Players.PlayerAdded:Connect(function(plr)
	
	if (DataMainStore:GetAsync(plr.UserId) == nil) then
		
		DataMainStore:SetAsync(plr.UserId, DefaultData)
		
		print("Default Data Loaded For Player "..plr.Name)
		
	end

	local data = DataMainStore:GetAsync(plr.UserId)
	
	Data.Campain2 = true
	
end)

game.Players.PlayerRemoving:Connect(function(plr)

	DataMainStore:SetAsync(plr.UserId, Data)
	
	print(Data)
	
end)

Why did you recreate a post that was active?

cus this one didint get any replies and idk how to remove

press the 3 dots and then the bin icon to delete a topic.

Flag your post and it should get deleted by a moderator, in the future only create posts if your current post hasn’t received any support in weeks.

oh wait i see now HOW DID MY DAM AS NOT SEE THAT ITS IN PLAIN SIGHT-

1 Like

I also resolved your issue in the other post, you need to do something with the data when retrieving it.

Nice, you found it.

You should probably delete this topic now as it is irrelevant, you can’t delete a topic after a certain amount of time it has been up, so do it fast because the other one is the main one now.

1 Like