Datastore not working

local DS = game:GetService("DataStoreService")

local Playerdata = DS:GetDataStore("RPFAData6")

game.Players.PlayerAdded:Connect(function(Player)

	local DataFolder = Instance.new("Folder")
	DataFolder.Parent = Player
	DataFolder.Name = "Data"

	local GeneralFolder = Instance.new("Folder")
	GeneralFolder.Parent = DataFolder
	GeneralFolder.Name = "General"

	local LightingFolder = Instance.new("Folder")
	LightingFolder.Parent = DataFolder
	LightingFolder.Name = "Lighting"

	local MiscFolder = Instance.new("Folder")
	MiscFolder.Parent = DataFolder
	MiscFolder.Name = "Misc"

	local PitchFolder = Instance.new("Folder")
	PitchFolder.Parent = DataFolder
	PitchFolder.Name = "Pitch"

	-- General

	local AngleOffset = Instance.new("NumberValue")
	AngleOffset.Parent = GeneralFolder
	AngleOffset.Name = "AngleOffset"
	AngleOffset.Value = 1

	local FOV = Instance.new("NumberValue")
	FOV.Parent = GeneralFolder
	FOV.Name = "FOV"
	FOV.Value = 70

	local HideFans = Instance.new("BoolValue")
	HideFans.Parent = GeneralFolder
	HideFans.Name = "HideFans"
	HideFans.Value = false

	local angleBar = Instance.new("BoolValue")
	angleBar.Parent = GeneralFolder
	angleBar.Name = "AngleBar"
	angleBar.Value = true

	local ReactBubble = Instance.new("BoolValue")
	ReactBubble.Parent = GeneralFolder
	ReactBubble.Name = "ReactBubble"
	ReactBubble.Value = true
	
	local Stadium = Instance.new("BoolValue")
	Stadium.Parent = GeneralFolder
	Stadium.Name = "Stadium"
	Stadium.Value = true
	
	local AngleBarMode = Instance.new("StringValue")
	AngleBarMode.Parent = GeneralFolder
	AngleBarMode.Name = "AngleBarMode"
	AngleBarMode.Value = "DEFAULT"

	-- Lighting

	local Time = Instance.new("NumberValue")
	Time.Parent = LightingFolder
	Time.Name = "Time"
	Time.Value = 5

	local Brightness = Instance.new("NumberValue")
	Brightness.Parent = LightingFolder
	Brightness.Name = "Brightness"
	Brightness.Value = 1

	local GeographicLatitude = Instance.new("NumberValue")
	GeographicLatitude.Parent = LightingFolder
	GeographicLatitude.Name = "GeographicLatitude"
	GeographicLatitude.Value = 45

	local Bloom = Instance.new("BoolValue")
	Bloom.Parent = LightingFolder
	Bloom.Name = "Bloom"
	Bloom.Value = true

	local SunRays = Instance.new("BoolValue")
	SunRays.Parent = LightingFolder
	SunRays.Name = "SunRays"
	SunRays.Value = true

	local ColorCorrection = Instance.new("BoolValue")
	ColorCorrection.Parent = LightingFolder
	ColorCorrection.Name = "ColorCorrection"
	ColorCorrection.Value = true

	-- Pitch

	local Textures = Instance.new("BoolValue")
	Textures.Parent = PitchFolder
	Textures.Name = "Textures"
	Textures.Value = true

	local PostTransparency = Instance.new("NumberValue")
	PostTransparency.Parent = PitchFolder
	PostTransparency.Name = "PostTransparency"
	PostTransparency.Value = 0

	local NetTransparency = Instance.new("NumberValue")
	NetTransparency.Parent = PitchFolder
	NetTransparency.Name = "NetTransparency"
	NetTransparency.Value = 0

	local PitchColor = Instance.new("StringValue")
	PitchColor.Parent = PitchFolder
	PitchColor.Name = "PitchColor"
	PitchColor.Value = "DarkGreen"

	local BallEffects = Instance.new("BoolValue")
	BallEffects.Parent = PitchFolder
	BallEffects.Name = "BallEffects"
	BallEffects.Value = true

	local BallSounds = Instance.new("BoolValue")
	BallSounds.Parent = PitchFolder
	BallSounds.Name = "BallSounds"
	BallSounds.Value = true

	-- Misc

	local Markers = Instance.new("BoolValue")
	Markers.Parent = MiscFolder
	Markers.Name = "Markers"
	Markers.Value = true

	local Percentage = Instance.new("BoolValue")
	Percentage.Parent = MiscFolder
	Percentage.Name = "Percentage"
	Percentage.Value = true

	local ShiftLock = Instance.new("StringValue")
	ShiftLock.Parent = MiscFolder
	ShiftLock.Name = "ShiftLock"
	ShiftLock.Value = "Right"
	

	local FootNotif = Instance.new("StringValue")
	FootNotif.Parent = MiscFolder
	FootNotif.Name = "FootNotif"
	FootNotif.Value = "Dynamic"

	local Pin = Instance.new("StringValue")
	Pin.Parent = MiscFolder
	Pin.Name = "Pin"
	Pin.Value = "None"

	local AnglebarColor = Instance.new("StringValue")
	AnglebarColor.Parent = MiscFolder
	AnglebarColor.Name = "AnglebarColor"
	AnglebarColor.Value = "0, 85, 255"

	local PowerbarColor = Instance.new("StringValue")
	PowerbarColor.Parent = MiscFolder
	PowerbarColor.Name = "PowerbarColor"
	PowerbarColor.Value = "33, 255, 154"

	local BackpackBorderColor = Instance.new("StringValue")
	BackpackBorderColor.Parent = MiscFolder
	BackpackBorderColor.Name = "BackpackBorderColor"
	BackpackBorderColor.Value = "90, 142, 233"

	local BackpackBackgroundColor = Instance.new("StringValue")
	BackpackBackgroundColor.Parent = MiscFolder
	BackpackBackgroundColor.Name = "BackpackBackgroundColor"
	BackpackBackgroundColor.Value = "49, 49, 49"

	local Key = "RPFAData-"..Player.UserId

	local Data = Playerdata:GetAsync(Key)

	if Data ~= nil then
		AngleOffset.Value = Data[1]
		FOV.Value = Data[2]
		HideFans.Value = Data[3]
		angleBar.Value = Data[4]    
		ReactBubble.Value = Data[5] 
		AngleBarMode.Value = Data[6]
		Stadium.Value = Data[7]
		Time.Value = Data[8]
		Brightness.Value = Data[9]
		Bloom.Value = Data[10]
		SunRays.Value = Data[11]
		ColorCorrection.Value = Data[12]
		-- Pitch
		BallEffects.Value = Data[13]
		BallSounds.Value = Data[14]
		Textures.Value = Data[15]
		PostTransparency.Value = Data[16]
		NetTransparency.Value = Data[17]
		PitchColor.Value = Data[18]
		-- Misc
		Markers.Value = Data[19]
		ShiftLock.Value = Data[20]
		FootNotif.Value = Data[21]
		Pin.Value = Data[23]
		AnglebarColor.Value = Data[23]
		PowerbarColor.Value = Data[24]
		BackpackBorderColor.Value = Data[25]
		BackpackBackgroundColor.Value = Data[26]
		Percentage.Value = Data[27]
	end

end)

game.Players.PlayerRemoving:Connect(function(Player)
	local Key = "RPFAData-"..Player.UserId

	local Data = {
		Player.Data.General.AngleOffset.Value,
		Player.Data.General.FOV.Value,
		Player.Data.General.HideFans.Value,
		Player.Data.General.AngleBar.Value,
		Player.Data.General.ReactBubble.Value,
		Player.Data.General.AngleBarMode.Value,
		Player.Data.General.Stadium.Value,
		Player.Data.Lighting.Time.Value,
		Player.Data.Lighting.Brightness.Value,
		Player.Data.Lighting.Bloom.Value,
		Player.Data.Lighting.SunRays.Value,
		Player.Data.Lighting.ColorCorrection.Value,
		Player.Data.Pitch.BallEffects.Value,
		Player.Data.Pitch.BallSounds.Value,
		Player.Data.Pitch.Textures.Value,
		Player.Data.Pitch.PostTransparency.Value,
		Player.Data.Pitch.NetTransparency.Value,
		Player.Data.Pitch.PitchColor.Value,
		Player.Data.Misc.Markers.Value,
		Player.Data.Misc.ShiftLock.Value,
		Player.Data.Misc.FootNotif.Value,
		Player.Data.Misc.Pin.Value,
		Player.Data.Misc.AnglebarColor.Value,
		Player.Data.Misc.PowerbarColor.Value,
		Player.Data.Misc.BackpackBorderColor.Value,
		Player.Data.Misc.BackpackBackgroundColor.Value,
		Player.Data.Misc.Percentage.Value,
	}

	Playerdata:SetAsync(Key, Data)

end)

I dont know why is that datastore not working there no errors , ive tried to find a method to fix in dev forum but all are not similar to mine , basically it doesnt save when i join game and change the value then join back the value becomes same as before not same as i changed ( i dont change using roblox studio its another script)

1 Like

Add this to the end of the script for now and see if it works:

game:BindToClose(function()
	task.wait(3)
end)

Also, wrap your SetAsync and GetAsync inside of a pcall so that the script doesn’t break if it fails to get the data.

pcall example
local success, errormessage = pcall(function()
	Playerdata:SetAsync(Key, Data)
end
if success then
	print("saved data")
elseif errormessage then
	warn(errormessage)
end
1 Like
local DS = game:GetService("DataStoreService")

local Playerdata = DS:GetDataStore("RPFAData6")

game.Players.PlayerAdded:Connect(function(Player)

	local DataFolder = Instance.new("Folder")
	DataFolder.Parent = Player
	DataFolder.Name = "Data"

	local GeneralFolder = Instance.new("Folder")
	GeneralFolder.Parent = DataFolder
	GeneralFolder.Name = "General"

	local LightingFolder = Instance.new("Folder")
	LightingFolder.Parent = DataFolder
	LightingFolder.Name = "Lighting"

	local MiscFolder = Instance.new("Folder")
	MiscFolder.Parent = DataFolder
	MiscFolder.Name = "Misc"

	local PitchFolder = Instance.new("Folder")
	PitchFolder.Parent = DataFolder
	PitchFolder.Name = "Pitch"

	-- General

	local AngleOffset = Instance.new("NumberValue")
	AngleOffset.Parent = GeneralFolder
	AngleOffset.Name = "AngleOffset"
	AngleOffset.Value = 1

	local FOV = Instance.new("NumberValue")
	FOV.Parent = GeneralFolder
	FOV.Name = "FOV"
	FOV.Value = 70

	local HideFans = Instance.new("BoolValue")
	HideFans.Parent = GeneralFolder
	HideFans.Name = "HideFans"
	HideFans.Value = false

	local angleBar = Instance.new("BoolValue")
	angleBar.Parent = GeneralFolder
	angleBar.Name = "AngleBar"
	angleBar.Value = true

	local ReactBubble = Instance.new("BoolValue")
	ReactBubble.Parent = GeneralFolder
	ReactBubble.Name = "ReactBubble"
	ReactBubble.Value = true
	
	local Stadium = Instance.new("BoolValue")
	Stadium.Parent = GeneralFolder
	Stadium.Name = "Stadium"
	Stadium.Value = true
	
	local AngleBarMode = Instance.new("StringValue")
	AngleBarMode.Parent = GeneralFolder
	AngleBarMode.Name = "AngleBarMode"
	AngleBarMode.Value = "DEFAULT"

	-- Lighting

	local Time = Instance.new("NumberValue")
	Time.Parent = LightingFolder
	Time.Name = "Time"
	Time.Value = 5

	local Brightness = Instance.new("NumberValue")
	Brightness.Parent = LightingFolder
	Brightness.Name = "Brightness"
	Brightness.Value = 1

	local GeographicLatitude = Instance.new("NumberValue")
	GeographicLatitude.Parent = LightingFolder
	GeographicLatitude.Name = "GeographicLatitude"
	GeographicLatitude.Value = 45

	local Bloom = Instance.new("BoolValue")
	Bloom.Parent = LightingFolder
	Bloom.Name = "Bloom"
	Bloom.Value = true

	local SunRays = Instance.new("BoolValue")
	SunRays.Parent = LightingFolder
	SunRays.Name = "SunRays"
	SunRays.Value = true

	local ColorCorrection = Instance.new("BoolValue")
	ColorCorrection.Parent = LightingFolder
	ColorCorrection.Name = "ColorCorrection"
	ColorCorrection.Value = true

	-- Pitch

	local Textures = Instance.new("BoolValue")
	Textures.Parent = PitchFolder
	Textures.Name = "Textures"
	Textures.Value = true

	local PostTransparency = Instance.new("NumberValue")
	PostTransparency.Parent = PitchFolder
	PostTransparency.Name = "PostTransparency"
	PostTransparency.Value = 0

	local NetTransparency = Instance.new("NumberValue")
	NetTransparency.Parent = PitchFolder
	NetTransparency.Name = "NetTransparency"
	NetTransparency.Value = 0

	local PitchColor = Instance.new("StringValue")
	PitchColor.Parent = PitchFolder
	PitchColor.Name = "PitchColor"
	PitchColor.Value = "DarkGreen"

	local BallEffects = Instance.new("BoolValue")
	BallEffects.Parent = PitchFolder
	BallEffects.Name = "BallEffects"
	BallEffects.Value = true

	local BallSounds = Instance.new("BoolValue")
	BallSounds.Parent = PitchFolder
	BallSounds.Name = "BallSounds"
	BallSounds.Value = true

	-- Misc

	local Markers = Instance.new("BoolValue")
	Markers.Parent = MiscFolder
	Markers.Name = "Markers"
	Markers.Value = true

	local Percentage = Instance.new("BoolValue")
	Percentage.Parent = MiscFolder
	Percentage.Name = "Percentage"
	Percentage.Value = true

	local ShiftLock = Instance.new("StringValue")
	ShiftLock.Parent = MiscFolder
	ShiftLock.Name = "ShiftLock"
	ShiftLock.Value = "Right"
	

	local FootNotif = Instance.new("StringValue")
	FootNotif.Parent = MiscFolder
	FootNotif.Name = "FootNotif"
	FootNotif.Value = "Dynamic"

	local Pin = Instance.new("StringValue")
	Pin.Parent = MiscFolder
	Pin.Name = "Pin"
	Pin.Value = "None"

	local AnglebarColor = Instance.new("StringValue")
	AnglebarColor.Parent = MiscFolder
	AnglebarColor.Name = "AnglebarColor"
	AnglebarColor.Value = "0, 85, 255"

	local PowerbarColor = Instance.new("StringValue")
	PowerbarColor.Parent = MiscFolder
	PowerbarColor.Name = "PowerbarColor"
	PowerbarColor.Value = "33, 255, 154"

	local BackpackBorderColor = Instance.new("StringValue")
	BackpackBorderColor.Parent = MiscFolder
	BackpackBorderColor.Name = "BackpackBorderColor"
	BackpackBorderColor.Value = "90, 142, 233"

	local BackpackBackgroundColor = Instance.new("StringValue")
	BackpackBackgroundColor.Parent = MiscFolder
	BackpackBackgroundColor.Name = "BackpackBackgroundColor"
	BackpackBackgroundColor.Value = "49, 49, 49"

	local Key = "RPFAData-"..Player.UserId

	local Data = Playerdata:GetAsync(Key)

	if Data ~= nil then
		AngleOffset.Value = Data[1]
		FOV.Value = Data[2]
		HideFans.Value = Data[3]
		angleBar.Value = Data[4]    
		ReactBubble.Value = Data[5] 
		AngleBarMode.Value = Data[6]
		Stadium.Value = Data[7]
		Time.Value = Data[8]
		Brightness.Value = Data[9]
		Bloom.Value = Data[10]
		SunRays.Value = Data[11]
		ColorCorrection.Value = Data[12]
		-- Pitch
		BallEffects.Value = Data[13]
		BallSounds.Value = Data[14]
		Textures.Value = Data[15]
		PostTransparency.Value = Data[16]
		NetTransparency.Value = Data[17]
		PitchColor.Value = Data[18]
		-- Misc
		Markers.Value = Data[19]
		ShiftLock.Value = Data[20]
		FootNotif.Value = Data[21]
		Pin.Value = Data[23]
		AnglebarColor.Value = Data[23]
		PowerbarColor.Value = Data[24]
		BackpackBorderColor.Value = Data[25]
		BackpackBackgroundColor.Value = Data[26]
		Percentage.Value = Data[27]
	end

end)

game.Players.PlayerRemoving:Connect(function(Player)
	local Key = "RPFAData-"..Player.UserId

	local Data = {
		Player.Data.General.AngleOffset.Value,
		Player.Data.General.FOV.Value,
		Player.Data.General.HideFans.Value,
		Player.Data.General.AngleBar.Value,
		Player.Data.General.ReactBubble.Value,
		Player.Data.General.AngleBarMode.Value,
		Player.Data.General.Stadium.Value,
		Player.Data.Lighting.Time.Value,
		Player.Data.Lighting.Brightness.Value,
		Player.Data.Lighting.Bloom.Value,
		Player.Data.Lighting.SunRays.Value,
		Player.Data.Lighting.ColorCorrection.Value,
		Player.Data.Pitch.BallEffects.Value,
		Player.Data.Pitch.BallSounds.Value,
		Player.Data.Pitch.Textures.Value,
		Player.Data.Pitch.PostTransparency.Value,
		Player.Data.Pitch.NetTransparency.Value,
		Player.Data.Pitch.PitchColor.Value,
		Player.Data.Misc.Markers.Value,
		Player.Data.Misc.ShiftLock.Value,
		Player.Data.Misc.FootNotif.Value,
		Player.Data.Misc.Pin.Value,
		Player.Data.Misc.AnglebarColor.Value,
		Player.Data.Misc.PowerbarColor.Value,
		Player.Data.Misc.BackpackBorderColor.Value,
		Player.Data.Misc.BackpackBackgroundColor.Value,
		Player.Data.Misc.Percentage.Value,
	}

	Playerdata:SetAsync(Key, Data)

end)

game:BindToClose(function()
	task.wait(3)
end)

like this ?

1 Like

Yes

Also, wrap it in a pcall like i mentioned earlier so that you can see if the data actually saves when you leave.

it prints saved data so i think the problem from get async maybe

Can you send me it? You probably forgot to define the variable above the pcall.

local DS = game:GetService("DataStoreService")

local Playerdata = DS:GetDataStore("RPFAData6")

game.Players.PlayerAdded:Connect(function(Player)

	local DataFolder = Instance.new("Folder")
	DataFolder.Parent = Player
	DataFolder.Name = "Data"

	local GeneralFolder = Instance.new("Folder")
	GeneralFolder.Parent = DataFolder
	GeneralFolder.Name = "General"

	local LightingFolder = Instance.new("Folder")
	LightingFolder.Parent = DataFolder
	LightingFolder.Name = "Lighting"

	local MiscFolder = Instance.new("Folder")
	MiscFolder.Parent = DataFolder
	MiscFolder.Name = "Misc"

	local PitchFolder = Instance.new("Folder")
	PitchFolder.Parent = DataFolder
	PitchFolder.Name = "Pitch"

	-- General

	local AngleOffset = Instance.new("NumberValue")
	AngleOffset.Parent = GeneralFolder
	AngleOffset.Name = "AngleOffset"
	AngleOffset.Value = 1

	local FOV = Instance.new("NumberValue")
	FOV.Parent = GeneralFolder
	FOV.Name = "FOV"
	FOV.Value = 70

	local HideFans = Instance.new("BoolValue")
	HideFans.Parent = GeneralFolder
	HideFans.Name = "HideFans"
	HideFans.Value = false

	local angleBar = Instance.new("BoolValue")
	angleBar.Parent = GeneralFolder
	angleBar.Name = "AngleBar"
	angleBar.Value = true

	local ReactBubble = Instance.new("BoolValue")
	ReactBubble.Parent = GeneralFolder
	ReactBubble.Name = "ReactBubble"
	ReactBubble.Value = true
	
	local Stadium = Instance.new("BoolValue")
	Stadium.Parent = GeneralFolder
	Stadium.Name = "Stadium"
	Stadium.Value = true
	
	local AngleBarMode = Instance.new("StringValue")
	AngleBarMode.Parent = GeneralFolder
	AngleBarMode.Name = "AngleBarMode"
	AngleBarMode.Value = "DEFAULT"

	-- Lighting

	local Time = Instance.new("NumberValue")
	Time.Parent = LightingFolder
	Time.Name = "Time"
	Time.Value = 5

	local Brightness = Instance.new("NumberValue")
	Brightness.Parent = LightingFolder
	Brightness.Name = "Brightness"
	Brightness.Value = 1

	local GeographicLatitude = Instance.new("NumberValue")
	GeographicLatitude.Parent = LightingFolder
	GeographicLatitude.Name = "GeographicLatitude"
	GeographicLatitude.Value = 45

	local Bloom = Instance.new("BoolValue")
	Bloom.Parent = LightingFolder
	Bloom.Name = "Bloom"
	Bloom.Value = true

	local SunRays = Instance.new("BoolValue")
	SunRays.Parent = LightingFolder
	SunRays.Name = "SunRays"
	SunRays.Value = true

	local ColorCorrection = Instance.new("BoolValue")
	ColorCorrection.Parent = LightingFolder
	ColorCorrection.Name = "ColorCorrection"
	ColorCorrection.Value = true

	-- Pitch

	local Textures = Instance.new("BoolValue")
	Textures.Parent = PitchFolder
	Textures.Name = "Textures"
	Textures.Value = true

	local PostTransparency = Instance.new("NumberValue")
	PostTransparency.Parent = PitchFolder
	PostTransparency.Name = "PostTransparency"
	PostTransparency.Value = 0

	local NetTransparency = Instance.new("NumberValue")
	NetTransparency.Parent = PitchFolder
	NetTransparency.Name = "NetTransparency"
	NetTransparency.Value = 0

	local PitchColor = Instance.new("StringValue")
	PitchColor.Parent = PitchFolder
	PitchColor.Name = "PitchColor"
	PitchColor.Value = "DarkGreen"

	local BallEffects = Instance.new("BoolValue")
	BallEffects.Parent = PitchFolder
	BallEffects.Name = "BallEffects"
	BallEffects.Value = true

	local BallSounds = Instance.new("BoolValue")
	BallSounds.Parent = PitchFolder
	BallSounds.Name = "BallSounds"
	BallSounds.Value = true

	-- Misc

	local Markers = Instance.new("BoolValue")
	Markers.Parent = MiscFolder
	Markers.Name = "Markers"
	Markers.Value = true

	local Percentage = Instance.new("BoolValue")
	Percentage.Parent = MiscFolder
	Percentage.Name = "Percentage"
	Percentage.Value = true

	local ShiftLock = Instance.new("StringValue")
	ShiftLock.Parent = MiscFolder
	ShiftLock.Name = "ShiftLock"
	ShiftLock.Value = "Right"
	

	local FootNotif = Instance.new("StringValue")
	FootNotif.Parent = MiscFolder
	FootNotif.Name = "FootNotif"
	FootNotif.Value = "Dynamic"

	local Pin = Instance.new("StringValue")
	Pin.Parent = MiscFolder
	Pin.Name = "Pin"
	Pin.Value = "None"

	local AnglebarColor = Instance.new("StringValue")
	AnglebarColor.Parent = MiscFolder
	AnglebarColor.Name = "AnglebarColor"
	AnglebarColor.Value = "0, 85, 255"

	local PowerbarColor = Instance.new("StringValue")
	PowerbarColor.Parent = MiscFolder
	PowerbarColor.Name = "PowerbarColor"
	PowerbarColor.Value = "33, 255, 154"

	local BackpackBorderColor = Instance.new("StringValue")
	BackpackBorderColor.Parent = MiscFolder
	BackpackBorderColor.Name = "BackpackBorderColor"
	BackpackBorderColor.Value = "90, 142, 233"

	local BackpackBackgroundColor = Instance.new("StringValue")
	BackpackBackgroundColor.Parent = MiscFolder
	BackpackBackgroundColor.Name = "BackpackBackgroundColor"
	BackpackBackgroundColor.Value = "49, 49, 49"

	local Key = "RPFAData-"..Player.UserId

	local Data = Playerdata:GetAsync(Key)

	if Data ~= nil then
		AngleOffset.Value = Data[1]
		FOV.Value = Data[2]
		HideFans.Value = Data[3]
		angleBar.Value = Data[4]    
		ReactBubble.Value = Data[5] 
		AngleBarMode.Value = Data[6]
		Stadium.Value = Data[7]
		Time.Value = Data[8]
		Brightness.Value = Data[9]
		Bloom.Value = Data[10]
		SunRays.Value = Data[11]
		ColorCorrection.Value = Data[12]
		-- Pitch
		BallEffects.Value = Data[13]
		BallSounds.Value = Data[14]
		Textures.Value = Data[15]
		PostTransparency.Value = Data[16]
		NetTransparency.Value = Data[17]
		PitchColor.Value = Data[18]
		-- Misc
		Markers.Value = Data[19]
		ShiftLock.Value = Data[20]
		FootNotif.Value = Data[21]
		Pin.Value = Data[23]
		AnglebarColor.Value = Data[23]
		PowerbarColor.Value = Data[24]
		BackpackBorderColor.Value = Data[25]
		BackpackBackgroundColor.Value = Data[26]
		Percentage.Value = Data[27]
	end

end)

game.Players.PlayerRemoving:Connect(function(Player)
	local Key = "RPFAData-"..Player.UserId

	local Data = {
		Player.Data.General.AngleOffset.Value,
		Player.Data.General.FOV.Value,
		Player.Data.General.HideFans.Value,
		Player.Data.General.AngleBar.Value,
		Player.Data.General.ReactBubble.Value,
		Player.Data.General.AngleBarMode.Value,
		Player.Data.General.Stadium.Value,
		Player.Data.Lighting.Time.Value,
		Player.Data.Lighting.Brightness.Value,
		Player.Data.Lighting.Bloom.Value,
		Player.Data.Lighting.SunRays.Value,
		Player.Data.Lighting.ColorCorrection.Value,
		Player.Data.Pitch.BallEffects.Value,
		Player.Data.Pitch.BallSounds.Value,
		Player.Data.Pitch.Textures.Value,
		Player.Data.Pitch.PostTransparency.Value,
		Player.Data.Pitch.NetTransparency.Value,
		Player.Data.Pitch.PitchColor.Value,
		Player.Data.Misc.Markers.Value,
		Player.Data.Misc.ShiftLock.Value,
		Player.Data.Misc.FootNotif.Value,
		Player.Data.Misc.Pin.Value,
		Player.Data.Misc.AnglebarColor.Value,
		Player.Data.Misc.PowerbarColor.Value,
		Player.Data.Misc.BackpackBorderColor.Value,
		Player.Data.Misc.BackpackBackgroundColor.Value,
		Player.Data.Misc.Percentage.Value,
	}

	local success, errormessage = pcall(function()
		Playerdata:SetAsync(Key, Data)
	end)
	if success then
		print("saved data")
	elseif errormessage then
		warn(errormessage)
	end

end)

game:BindToClose(function()
	task.wait(3)
end)

Add the pcall to the GetAsync and then print the data

local Data
local success, errormessage = pcall(function()
	Data = Playerdata:GetAsync(Key)
end
if success then
	if Data ~= nil then
		AngleOffset.Value = Data[1]
		FOV.Value = Data[2]
		HideFans.Value = Data[3]
		angleBar.Value = Data[4]    
		ReactBubble.Value = Data[5] 
		AngleBarMode.Value = Data[6]
		Stadium.Value = Data[7]
		Time.Value = Data[8]
		Brightness.Value = Data[9]
		Bloom.Value = Data[10]
		SunRays.Value = Data[11]
		ColorCorrection.Value = Data[12]
		-- Pitch
		BallEffects.Value = Data[13]
		BallSounds.Value = Data[14]
		Textures.Value = Data[15]
		PostTransparency.Value = Data[16]
		NetTransparency.Value = Data[17]
		PitchColor.Value = Data[18]
		-- Misc
		Markers.Value = Data[19]
		ShiftLock.Value = Data[20]
		FootNotif.Value = Data[21]
		Pin.Value = Data[23]
		AnglebarColor.Value = Data[23]
		PowerbarColor.Value = Data[24]
		BackpackBorderColor.Value = Data[25]
		BackpackBackgroundColor.Value = Data[26]
		Percentage.Value = Data[27]
	end
else
	warn(errormessage)
end

Also, is it giving you any errors/warnings?

local DS = game:GetService("DataStoreService")

local Playerdata = DS:GetDataStore("RPFAData6")

game.Players.PlayerAdded:Connect(function(Player)

	local DataFolder = Instance.new("Folder")
	DataFolder.Parent = Player
	DataFolder.Name = "Data"

	local GeneralFolder = Instance.new("Folder")
	GeneralFolder.Parent = DataFolder
	GeneralFolder.Name = "General"

	local LightingFolder = Instance.new("Folder")
	LightingFolder.Parent = DataFolder
	LightingFolder.Name = "Lighting"

	local MiscFolder = Instance.new("Folder")
	MiscFolder.Parent = DataFolder
	MiscFolder.Name = "Misc"

	local PitchFolder = Instance.new("Folder")
	PitchFolder.Parent = DataFolder
	PitchFolder.Name = "Pitch"

	-- General

	local AngleOffset = Instance.new("NumberValue")
	AngleOffset.Parent = GeneralFolder
	AngleOffset.Name = "AngleOffset"
	AngleOffset.Value = 1

	local FOV = Instance.new("NumberValue")
	FOV.Parent = GeneralFolder
	FOV.Name = "FOV"
	FOV.Value = 70

	local HideFans = Instance.new("BoolValue")
	HideFans.Parent = GeneralFolder
	HideFans.Name = "HideFans"
	HideFans.Value = false

	local angleBar = Instance.new("BoolValue")
	angleBar.Parent = GeneralFolder
	angleBar.Name = "AngleBar"
	angleBar.Value = true

	local ReactBubble = Instance.new("BoolValue")
	ReactBubble.Parent = GeneralFolder
	ReactBubble.Name = "ReactBubble"
	ReactBubble.Value = true
	
	local Stadium = Instance.new("BoolValue")
	Stadium.Parent = GeneralFolder
	Stadium.Name = "Stadium"
	Stadium.Value = true
	
	local AngleBarMode = Instance.new("StringValue")
	AngleBarMode.Parent = GeneralFolder
	AngleBarMode.Name = "AngleBarMode"
	AngleBarMode.Value = "DEFAULT"

	-- Lighting

	local Time = Instance.new("NumberValue")
	Time.Parent = LightingFolder
	Time.Name = "Time"
	Time.Value = 5

	local Brightness = Instance.new("NumberValue")
	Brightness.Parent = LightingFolder
	Brightness.Name = "Brightness"
	Brightness.Value = 1

	local GeographicLatitude = Instance.new("NumberValue")
	GeographicLatitude.Parent = LightingFolder
	GeographicLatitude.Name = "GeographicLatitude"
	GeographicLatitude.Value = 45

	local Bloom = Instance.new("BoolValue")
	Bloom.Parent = LightingFolder
	Bloom.Name = "Bloom"
	Bloom.Value = true

	local SunRays = Instance.new("BoolValue")
	SunRays.Parent = LightingFolder
	SunRays.Name = "SunRays"
	SunRays.Value = true

	local ColorCorrection = Instance.new("BoolValue")
	ColorCorrection.Parent = LightingFolder
	ColorCorrection.Name = "ColorCorrection"
	ColorCorrection.Value = true

	-- Pitch

	local Textures = Instance.new("BoolValue")
	Textures.Parent = PitchFolder
	Textures.Name = "Textures"
	Textures.Value = true

	local PostTransparency = Instance.new("NumberValue")
	PostTransparency.Parent = PitchFolder
	PostTransparency.Name = "PostTransparency"
	PostTransparency.Value = 0

	local NetTransparency = Instance.new("NumberValue")
	NetTransparency.Parent = PitchFolder
	NetTransparency.Name = "NetTransparency"
	NetTransparency.Value = 0

	local PitchColor = Instance.new("StringValue")
	PitchColor.Parent = PitchFolder
	PitchColor.Name = "PitchColor"
	PitchColor.Value = "DarkGreen"

	local BallEffects = Instance.new("BoolValue")
	BallEffects.Parent = PitchFolder
	BallEffects.Name = "BallEffects"
	BallEffects.Value = true

	local BallSounds = Instance.new("BoolValue")
	BallSounds.Parent = PitchFolder
	BallSounds.Name = "BallSounds"
	BallSounds.Value = true

	-- Misc

	local Markers = Instance.new("BoolValue")
	Markers.Parent = MiscFolder
	Markers.Name = "Markers"
	Markers.Value = true

	local Percentage = Instance.new("BoolValue")
	Percentage.Parent = MiscFolder
	Percentage.Name = "Percentage"
	Percentage.Value = true

	local ShiftLock = Instance.new("StringValue")
	ShiftLock.Parent = MiscFolder
	ShiftLock.Name = "ShiftLock"
	ShiftLock.Value = "Right"
	

	local FootNotif = Instance.new("StringValue")
	FootNotif.Parent = MiscFolder
	FootNotif.Name = "FootNotif"
	FootNotif.Value = "Dynamic"

	local Pin = Instance.new("StringValue")
	Pin.Parent = MiscFolder
	Pin.Name = "Pin"
	Pin.Value = "None"

	local AnglebarColor = Instance.new("StringValue")
	AnglebarColor.Parent = MiscFolder
	AnglebarColor.Name = "AnglebarColor"
	AnglebarColor.Value = "0, 85, 255"

	local PowerbarColor = Instance.new("StringValue")
	PowerbarColor.Parent = MiscFolder
	PowerbarColor.Name = "PowerbarColor"
	PowerbarColor.Value = "33, 255, 154"

	local BackpackBorderColor = Instance.new("StringValue")
	BackpackBorderColor.Parent = MiscFolder
	BackpackBorderColor.Name = "BackpackBorderColor"
	BackpackBorderColor.Value = "90, 142, 233"

	local BackpackBackgroundColor = Instance.new("StringValue")
	BackpackBackgroundColor.Parent = MiscFolder
	BackpackBackgroundColor.Name = "BackpackBackgroundColor"
	BackpackBackgroundColor.Value = "49, 49, 49"

	local Key = "RPFAData-"..Player.UserId
	local Data
	local success, errormessage = pcall(function()
		Data = Playerdata:GetAsync(Key)
	end)
	if success then
		if Data ~= nil then
			AngleOffset.Value = Data[1]
			FOV.Value = Data[2]
			HideFans.Value = Data[3]
			angleBar.Value = Data[4]    
			ReactBubble.Value = Data[5] 
			AngleBarMode.Value = Data[6]
			Stadium.Value = Data[7]
			Time.Value = Data[8]
			Brightness.Value = Data[9]
			Bloom.Value = Data[10]
			SunRays.Value = Data[11]
			ColorCorrection.Value = Data[12]
			-- Pitch
			BallEffects.Value = Data[13]
			BallSounds.Value = Data[14]
			Textures.Value = Data[15]
			PostTransparency.Value = Data[16]
			NetTransparency.Value = Data[17]
			PitchColor.Value = Data[18]
			-- Misc
			Markers.Value = Data[19]
			ShiftLock.Value = Data[20]
			FootNotif.Value = Data[21]
			Pin.Value = Data[23]
			AnglebarColor.Value = Data[23]
			PowerbarColor.Value = Data[24]
			BackpackBorderColor.Value = Data[25]
			BackpackBackgroundColor.Value = Data[26]
			Percentage.Value = Data[27]
		end
	else
		warn(errormessage)
	end

end)

game.Players.PlayerRemoving:Connect(function(Player)
	local Key = "RPFAData-"..Player.UserId

	local Data = {
		Player.Data.General.AngleOffset.Value,
		Player.Data.General.FOV.Value,
		Player.Data.General.HideFans.Value,
		Player.Data.General.AngleBar.Value,
		Player.Data.General.ReactBubble.Value,
		Player.Data.General.AngleBarMode.Value,
		Player.Data.General.Stadium.Value,
		Player.Data.Lighting.Time.Value,
		Player.Data.Lighting.Brightness.Value,
		Player.Data.Lighting.Bloom.Value,
		Player.Data.Lighting.SunRays.Value,
		Player.Data.Lighting.ColorCorrection.Value,
		Player.Data.Pitch.BallEffects.Value,
		Player.Data.Pitch.BallSounds.Value,
		Player.Data.Pitch.Textures.Value,
		Player.Data.Pitch.PostTransparency.Value,
		Player.Data.Pitch.NetTransparency.Value,
		Player.Data.Pitch.PitchColor.Value,
		Player.Data.Misc.Markers.Value,
		Player.Data.Misc.ShiftLock.Value,
		Player.Data.Misc.FootNotif.Value,
		Player.Data.Misc.Pin.Value,
		Player.Data.Misc.AnglebarColor.Value,
		Player.Data.Misc.PowerbarColor.Value,
		Player.Data.Misc.BackpackBorderColor.Value,
		Player.Data.Misc.BackpackBackgroundColor.Value,
		Player.Data.Misc.Percentage.Value,
	}

	local success, errormessage = pcall(function()
		Playerdata:SetAsync(Key, Data)
	end)
	if success then
		print("saved data")
	elseif errormessage then
		warn(errormessage)
	end

end)

game:BindToClose(function()
	task.wait(3)
end)```
no errors just prints saved data also in getasync there no warns , so totally no any warns and no errors

its acctually weird that it doesnt work for no reason

Add print(Data) under if success then and see if the information it printed is correct. If it is, then the issue is with applying the data to the values.

if success then
	print(Data)
		if Data ~= nil then
			AngleOffset.Value = Data[1]
			FOV.Value = Data[2]
			HideFans.Value = Data[3]
local DS = game:GetService("DataStoreService")

local Playerdata = DS:GetDataStore("RPFAData6")

game.Players.PlayerAdded:Connect(function(Player)

	local DataFolder = Instance.new("Folder")
	DataFolder.Parent = Player
	DataFolder.Name = "Data"

	local GeneralFolder = Instance.new("Folder")
	GeneralFolder.Parent = DataFolder
	GeneralFolder.Name = "General"

	local LightingFolder = Instance.new("Folder")
	LightingFolder.Parent = DataFolder
	LightingFolder.Name = "Lighting"

	local MiscFolder = Instance.new("Folder")
	MiscFolder.Parent = DataFolder
	MiscFolder.Name = "Misc"

	local PitchFolder = Instance.new("Folder")
	PitchFolder.Parent = DataFolder
	PitchFolder.Name = "Pitch"

	-- General

	local AngleOffset = Instance.new("NumberValue")
	AngleOffset.Parent = GeneralFolder
	AngleOffset.Name = "AngleOffset"
	AngleOffset.Value = 1

	local FOV = Instance.new("NumberValue")
	FOV.Parent = GeneralFolder
	FOV.Name = "FOV"
	FOV.Value = 70

	local HideFans = Instance.new("BoolValue")
	HideFans.Parent = GeneralFolder
	HideFans.Name = "HideFans"
	HideFans.Value = false

	local angleBar = Instance.new("BoolValue")
	angleBar.Parent = GeneralFolder
	angleBar.Name = "AngleBar"
	angleBar.Value = true

	local ReactBubble = Instance.new("BoolValue")
	ReactBubble.Parent = GeneralFolder
	ReactBubble.Name = "ReactBubble"
	ReactBubble.Value = true
	
	local Stadium = Instance.new("BoolValue")
	Stadium.Parent = GeneralFolder
	Stadium.Name = "Stadium"
	Stadium.Value = true
	
	local AngleBarMode = Instance.new("StringValue")
	AngleBarMode.Parent = GeneralFolder
	AngleBarMode.Name = "AngleBarMode"
	AngleBarMode.Value = "DEFAULT"

	-- Lighting

	local Time = Instance.new("NumberValue")
	Time.Parent = LightingFolder
	Time.Name = "Time"
	Time.Value = 5

	local Brightness = Instance.new("NumberValue")
	Brightness.Parent = LightingFolder
	Brightness.Name = "Brightness"
	Brightness.Value = 1

	local GeographicLatitude = Instance.new("NumberValue")
	GeographicLatitude.Parent = LightingFolder
	GeographicLatitude.Name = "GeographicLatitude"
	GeographicLatitude.Value = 45

	local Bloom = Instance.new("BoolValue")
	Bloom.Parent = LightingFolder
	Bloom.Name = "Bloom"
	Bloom.Value = true

	local SunRays = Instance.new("BoolValue")
	SunRays.Parent = LightingFolder
	SunRays.Name = "SunRays"
	SunRays.Value = true

	local ColorCorrection = Instance.new("BoolValue")
	ColorCorrection.Parent = LightingFolder
	ColorCorrection.Name = "ColorCorrection"
	ColorCorrection.Value = true

	-- Pitch

	local Textures = Instance.new("BoolValue")
	Textures.Parent = PitchFolder
	Textures.Name = "Textures"
	Textures.Value = true

	local PostTransparency = Instance.new("NumberValue")
	PostTransparency.Parent = PitchFolder
	PostTransparency.Name = "PostTransparency"
	PostTransparency.Value = 0

	local NetTransparency = Instance.new("NumberValue")
	NetTransparency.Parent = PitchFolder
	NetTransparency.Name = "NetTransparency"
	NetTransparency.Value = 0

	local PitchColor = Instance.new("StringValue")
	PitchColor.Parent = PitchFolder
	PitchColor.Name = "PitchColor"
	PitchColor.Value = "DarkGreen"

	local BallEffects = Instance.new("BoolValue")
	BallEffects.Parent = PitchFolder
	BallEffects.Name = "BallEffects"
	BallEffects.Value = true

	local BallSounds = Instance.new("BoolValue")
	BallSounds.Parent = PitchFolder
	BallSounds.Name = "BallSounds"
	BallSounds.Value = true

	-- Misc

	local Markers = Instance.new("BoolValue")
	Markers.Parent = MiscFolder
	Markers.Name = "Markers"
	Markers.Value = true

	local Percentage = Instance.new("BoolValue")
	Percentage.Parent = MiscFolder
	Percentage.Name = "Percentage"
	Percentage.Value = true

	local ShiftLock = Instance.new("StringValue")
	ShiftLock.Parent = MiscFolder
	ShiftLock.Name = "ShiftLock"
	ShiftLock.Value = "Right"
	

	local FootNotif = Instance.new("StringValue")
	FootNotif.Parent = MiscFolder
	FootNotif.Name = "FootNotif"
	FootNotif.Value = "Dynamic"

	local Pin = Instance.new("StringValue")
	Pin.Parent = MiscFolder
	Pin.Name = "Pin"
	Pin.Value = "None"

	local AnglebarColor = Instance.new("StringValue")
	AnglebarColor.Parent = MiscFolder
	AnglebarColor.Name = "AnglebarColor"
	AnglebarColor.Value = "0, 85, 255"

	local PowerbarColor = Instance.new("StringValue")
	PowerbarColor.Parent = MiscFolder
	PowerbarColor.Name = "PowerbarColor"
	PowerbarColor.Value = "33, 255, 154"

	local BackpackBorderColor = Instance.new("StringValue")
	BackpackBorderColor.Parent = MiscFolder
	BackpackBorderColor.Name = "BackpackBorderColor"
	BackpackBorderColor.Value = "90, 142, 233"

	local BackpackBackgroundColor = Instance.new("StringValue")
	BackpackBackgroundColor.Parent = MiscFolder
	BackpackBackgroundColor.Name = "BackpackBackgroundColor"
	BackpackBackgroundColor.Value = "49, 49, 49"

	local Key = "RPFAData-"..Player.UserId
	local Data
	local success, errormessage = pcall(function()
		Data = Playerdata:GetAsync(Key)
	end)
	if success then
		print("data:")
		print(Data)
		if Data ~= nil then
			AngleOffset.Value = Data[1]
			FOV.Value = Data[2]
			HideFans.Value = Data[3]
			angleBar.Value = Data[4]    
			ReactBubble.Value = Data[5] 
			AngleBarMode.Value = Data[6]
			Stadium.Value = Data[7]
			Time.Value = Data[8]
			Brightness.Value = Data[9]
			Bloom.Value = Data[10]
			SunRays.Value = Data[11]
			ColorCorrection.Value = Data[12]
			-- Pitch
			BallEffects.Value = Data[13]
			BallSounds.Value = Data[14]
			Textures.Value = Data[15]
			PostTransparency.Value = Data[16]
			NetTransparency.Value = Data[17]
			PitchColor.Value = Data[18]
			-- Misc
			Markers.Value = Data[19]
			ShiftLock.Value = Data[20]
			FootNotif.Value = Data[21]
			Pin.Value = Data[23]
			AnglebarColor.Value = Data[23]
			PowerbarColor.Value = Data[24]
			BackpackBorderColor.Value = Data[25]
			BackpackBackgroundColor.Value = Data[26]
			Percentage.Value = Data[27]
		end
	else
		warn(errormessage)
	end

end)

game.Players.PlayerRemoving:Connect(function(Player)
	local Key = "RPFAData-"..Player.UserId

	local Data = {
		Player.Data.General.AngleOffset.Value,
		Player.Data.General.FOV.Value,
		Player.Data.General.HideFans.Value,
		Player.Data.General.AngleBar.Value,
		Player.Data.General.ReactBubble.Value,
		Player.Data.General.AngleBarMode.Value,
		Player.Data.General.Stadium.Value,
		Player.Data.Lighting.Time.Value,
		Player.Data.Lighting.Brightness.Value,
		Player.Data.Lighting.Bloom.Value,
		Player.Data.Lighting.SunRays.Value,
		Player.Data.Lighting.ColorCorrection.Value,
		Player.Data.Pitch.BallEffects.Value,
		Player.Data.Pitch.BallSounds.Value,
		Player.Data.Pitch.Textures.Value,
		Player.Data.Pitch.PostTransparency.Value,
		Player.Data.Pitch.NetTransparency.Value,
		Player.Data.Pitch.PitchColor.Value,
		Player.Data.Misc.Markers.Value,
		Player.Data.Misc.ShiftLock.Value,
		Player.Data.Misc.FootNotif.Value,
		Player.Data.Misc.Pin.Value,
		Player.Data.Misc.AnglebarColor.Value,
		Player.Data.Misc.PowerbarColor.Value,
		Player.Data.Misc.BackpackBorderColor.Value,
		Player.Data.Misc.BackpackBackgroundColor.Value,
		Player.Data.Misc.Percentage.Value,
	}

	local success, errormessage = pcall(function()
		Playerdata:SetAsync(Key, Data)
	end)
	if success then
		print("saved data")
	elseif errormessage then
		warn(errormessage)
	end

end)

game:BindToClose(function()
	task.wait(3)
end)

it prints nothing ive tried 2 times first i thought because there was alot of prints in my game i wouldnt see it so i made another print before it to mark it , under that marking print there is no printing like empty not even empty line but nothing

Maybe try to manually change the data in SetAsync to see if it changes anything.

Playerdata:SetAsync(Key, "test value thing")

I don’t really know what is causing the issue.

i remember that it was working before , but after adding a new value it broke

Which value was it?

By the way, maybe try converting/deconverting it to JSON before saving/loading. I don’t think that this will solve it but you might as well try.

i added Stadium and AngleBarMode and i removed BallHold and pattern thats the old script :

local DS = game:GetService("DataStoreService")

local Playerdata = DS:GetDataStore("RPFAData3")

game.Players.PlayerAdded:Connect(function(Player)

	local DataFolder = Instance.new("Folder")
	DataFolder.Parent = Player
	DataFolder.Name = "Data"

	local GeneralFolder = Instance.new("Folder")
	GeneralFolder.Parent = DataFolder
	GeneralFolder.Name = "General"

	local LightingFolder = Instance.new("Folder")
	LightingFolder.Parent = DataFolder
	LightingFolder.Name = "Lighting"

	local MiscFolder = Instance.new("Folder")
	MiscFolder.Parent = DataFolder
	MiscFolder.Name = "Misc"

	local PitchFolder = Instance.new("Folder")
	PitchFolder.Parent = DataFolder
	PitchFolder.Name = "Pitch"

	-- General

	local AngleOffset = Instance.new("NumberValue")
	AngleOffset.Parent = GeneralFolder
	AngleOffset.Name = "AngleOffset"
	AngleOffset.Value = 1

	local FOV = Instance.new("NumberValue")
	FOV.Parent = GeneralFolder
	FOV.Name = "FOV"
	FOV.Value = 70

	local HideFans = Instance.new("BoolValue")
	HideFans.Parent = GeneralFolder
	HideFans.Name = "HideFans"
	HideFans.Value = false

	local angleBar = Instance.new("BoolValue")
	angleBar.Parent = GeneralFolder
	angleBar.Name = "AngleBar"
	angleBar.Value = true

	local ReactBubble = Instance.new("BoolValue")
	ReactBubble.Parent = GeneralFolder
	ReactBubble.Name = "ReactBubble"
	ReactBubble.Value = true

	-- Lighting

	local Time = Instance.new("NumberValue")
	Time.Parent = LightingFolder
	Time.Name = "Time"
	Time.Value = 5

	local Brightness = Instance.new("NumberValue")
	Brightness.Parent = LightingFolder
	Brightness.Name = "Brightness"
	Brightness.Value = 1

	local GeographicLatitude = Instance.new("NumberValue")
	GeographicLatitude.Parent = LightingFolder
	GeographicLatitude.Name = "GeographicLatitude"
	GeographicLatitude.Value = 45

	local Bloom = Instance.new("BoolValue")
	Bloom.Parent = LightingFolder
	Bloom.Name = "Bloom"
	Bloom.Value = true

	local SunRays = Instance.new("BoolValue")
	SunRays.Parent = LightingFolder
	SunRays.Name = "SunRays"
	SunRays.Value = true

	local ColorCorrection = Instance.new("BoolValue")
	ColorCorrection.Parent = LightingFolder
	ColorCorrection.Name = "ColorCorrection"
	ColorCorrection.Value = true

	-- Pitch

	local Textures = Instance.new("BoolValue")
	Textures.Parent = PitchFolder
	Textures.Name = "Textures"
	Textures.Value = true

	local Pattern = Instance.new("StringValue")
	Pattern.Parent = PitchFolder
	Pattern.Name = "Pattern"
	Pattern.Value = "Stripe"

	local PostTransparency = Instance.new("NumberValue")
	PostTransparency.Parent = PitchFolder
	PostTransparency.Name = "PostTransparency"
	PostTransparency.Value = 0

	local NetTransparency = Instance.new("NumberValue")
	NetTransparency.Parent = PitchFolder
	NetTransparency.Name = "NetTransparency"
	NetTransparency.Value = 0

	local PitchColor = Instance.new("StringValue")
	PitchColor.Parent = PitchFolder
	PitchColor.Name = "PitchColor"
	PitchColor.Value = "DarkGreen"

	local BallEffects = Instance.new("BoolValue")
	BallEffects.Parent = PitchFolder
	BallEffects.Name = "BallEffects"
	BallEffects.Value = true

	local BallSounds = Instance.new("BoolValue")
	BallSounds.Parent = PitchFolder
	BallSounds.Name = "BallSounds"
	BallSounds.Value = true

	-- Misc

	local Markers = Instance.new("BoolValue")
	Markers.Parent = MiscFolder
	Markers.Name = "Markers"
	Markers.Value = true

	local Percentage = Instance.new("BoolValue")
	Percentage.Parent = MiscFolder
	Percentage.Name = "Percentage"
	Percentage.Value = true

	local ShiftLock = Instance.new("StringValue")
	ShiftLock.Parent = MiscFolder
	ShiftLock.Name = "ShiftLock"
	ShiftLock.Value = "Right"
	

	local FootNotif = Instance.new("StringValue")
	FootNotif.Parent = MiscFolder
	FootNotif.Name = "FootNotif"
	FootNotif.Value = "Dynamic"

	local Pin = Instance.new("StringValue")
	Pin.Parent = MiscFolder
	Pin.Name = "Pin"
	Pin.Value = "None"

	local AnglebarColor = Instance.new("StringValue")
	AnglebarColor.Parent = MiscFolder
	AnglebarColor.Name = "AnglebarColor"
	AnglebarColor.Value = "0, 85, 255"

	local PowerbarColor = Instance.new("StringValue")
	PowerbarColor.Parent = MiscFolder
	PowerbarColor.Name = "PowerbarColor"
	PowerbarColor.Value = "33, 255, 154"

	local BackpackBorderColor = Instance.new("StringValue")
	BackpackBorderColor.Parent = MiscFolder
	BackpackBorderColor.Name = "BackpackBorderColor"
	BackpackBorderColor.Value = "90, 142, 233"

	local BackpackBackgroundColor = Instance.new("StringValue")
	BackpackBackgroundColor.Parent = MiscFolder
	BackpackBackgroundColor.Name = "BackpackBackgroundColor"
	BackpackBackgroundColor.Value = "49, 49, 49"

	local BallHold = Instance.new("BoolValue")
	BallHold.Parent = DataFolder
	BallHold.Name = "BallHold"
	BallHold.Value = "Hold"

	local Key = "RPFAData-"..Player.UserId

	local Data = Playerdata:GetAsync(Key)

	if Data ~= nil then
		AngleOffset.Value = Data[1]
		FOV.Value = Data[2]
		HideFans.Value = Data[3]
		angleBar.Value = Data[4]    
		ReactBubble.Value = Data[5] 
		Time.Value = Data[6]
		Brightness.Value = Data[7]
		Bloom.Value = Data[8]
		SunRays.Value = Data[9]
		ColorCorrection.Value = Data[10]
		-- Pitch
		BallEffects.Value = Data[11]
		BallSounds.Value = Data[12]
		Textures.Value = Data[13]
		Pattern.Value = Data[14]
		PostTransparency.Value = Data[15]
		NetTransparency.Value = Data[16]
		PitchColor.Value = Data[17]
		-- Misc
		Markers.Value = Data[18]
		ShiftLock.Value = Data[19]
		FootNotif.Value = Data[20]
		Pin.Value = Data[21]
		AnglebarColor.Value = Data[22]
		PowerbarColor.Value = Data[23]
		BackpackBorderColor.Value = Data[24]
		BackpackBackgroundColor.Value = Data[25]
		Percentage.Value = Data[26]

		-- Skybox
		if Data[26] ~= nil then
			BallHold.Value = Data[26]

		end
	end

end)

game.Players.PlayerRemoving:Connect(function(Player)
	local Key = "RPFAData-"..Player.UserId

	local Data = {
		Player.Data.General.AngleOffset.Value,
		Player.Data.General.FOV.Value,
		Player.Data.General.HideFans.Value,
		Player.Data.General.AngleBar.Value,
		Player.Data.General.ReactBubble.Value,

		Player.Data.Lighting.Time.Value,
		Player.Data.Lighting.Brightness.Value,
		Player.Data.Lighting.Bloom.Value,
		Player.Data.Lighting.SunRays.Value,
		Player.Data.Lighting.ColorCorrection.Value,

		Player.Data.Pitch.BallEffects.Value,
		Player.Data.Pitch.BallSounds.Value,

		Player.Data.Pitch.Textures.Value,
		Player.Data.Pitch.Pattern.Value,
		Player.Data.Pitch.PostTransparency.Value,
		Player.Data.Pitch.NetTransparency.Value,
		Player.Data.Pitch.PitchColor.Value,

		Player.Data.Misc.Markers.Value,
		Player.Data.Misc.ShiftLock.Value,
		Player.Data.Misc.FootNotif.Value,
		Player.Data.Misc.Pin.Value,
		Player.Data.Misc.AnglebarColor.Value,
		Player.Data.Misc.PowerbarColor.Value,
		Player.Data.Misc.BackpackBorderColor.Value,
		Player.Data.Misc.BackpackBackgroundColor.Value,
		Player.Data.Misc.Percentage.Value,

		Player.Data.BallHold.Value,
	}

	Playerdata:SetAsync(Key, Data)

end)

thats the old script , it wont work if i test because its settings datastore so new settings = new values i need to remove the new settings so it works

Like I said in the edited version of my last post, I would try to encode the data to JSON and see if that fixes it. Everything else looks fine so I don’t really know what else to do.

how do i encode the data to json

--At the top of your script
local HttpsService = game:GetService("HttpService")

--Loading
local JSONData
local success, errormessage = pcall(function()
	JSONData = Playerdata:GetAsync(Key)
end)

local Data = HttpsService:JSONDecode(JSONData)

--Saving
local JSONData = HttpsService:JsonEncode(Data)

local success, errormessage = pcall(function()
		Playerdata:SetAsync(Key, JSONData)
end)

Again, this probably won’t solve your issue but its worth trying.