Getting My Saved Randomized Height/Weight With DataStore2

So I’m making a auto height/weight generation script for my game.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")

local DataStore2 = require(script.DataStore2)

DataStore2.Combine("DATA", "Wins")
DataStore2.Combine("DATA", "Losses")
DataStore2.Combine("DATA", "Bucks")
DataStore2.Combine("DATA", "Cosmetics")
DataStore2.Combine("DATA", "Slot1Biometrics")
DataStore2.Combine("DATA", "Slot1SkinTone")
DataStore2.Combine("DATA", "Slot1FightingStyle")
DataStore2.Combine("DATA", "Slot1Stats")

Players.PlayerAdded:Connect(function(player)
	
	local WinStore = DataStore2("Wins", player)
	local LossStore = DataStore2("Losses", player)
	local BucksStore = DataStore2("Bucks", player)
	local CosmeticStore = DataStore2("Cosmetics", player)
	local Slot1BiometricStore = DataStore2("Slot1Biometrics", player)
	local Slot1SkinTone = DataStore2("Slot1SkinTone", player)
	local Slot1FightingStyle = DataStore2("Slot1FightingStyle", player)
	local Slot1StatsStore = DataStore2("Slot1Stats", player)

	local function GetWins(value)
		ReplicatedStorage.PlayerDataStoreEvents.Wins:FireClient(player, value)
	end
	
	local function GetLosses(value)
		ReplicatedStorage.PlayerDataStoreEvents.Losses:FireClient(player, value)
	end
	
	local function GetBucks(value)
		ReplicatedStorage.PlayerDataStoreEvents.Bucks:FireClient(player, value)
	end
	
	local function GetCosmetics(value)
		CosmeticStore:Set(value)
	end
	
	local function GetSlot1Biometrics(value)
		Slot1BiometricStore:Set(value)
	end
	
	local function GetSlot1SkinTone(value)
		Slot1SkinTone:Set(value)
	end
	
	local function GetSlot1FightingStyle(value)
		Slot1FightingStyle:Set(value)
	end
	
	local function GetSlot1Stats(value)
		Slot1StatsStore:Set(value)
	end

	GetWins(WinStore:Get())
	GetLosses(LossStore:Get())
	GetBucks(BucksStore:Get())
	GetSlot1Biometrics({})
	GetCosmetics({})
	GetSlot1SkinTone({})
	GetSlot1FightingStyle({})	
	GetSlot1Stats({})
	
	CosmeticStore:OnUpdate(GetCosmetics)
	Slot1FightingStyle:OnUpdate(GetSlot1FightingStyle)
	Slot1BiometricStore:OnUpdate(GetSlot1Biometrics)
	Slot1SkinTone:OnUpdate(GetSlot1SkinTone)	
	Slot1StatsStore:OnUpdate(GetSlot1Stats)
	WinStore:OnUpdate(GetWins)
	LossStore:OnUpdate(GetLosses)
	BucksStore:OnUpdate(GetBucks)
end)

-- This is a RemoteEvent where a player can purchase a product by its name.

ReplicatedStorage.PlayerDataStoreEvents.BuyItem.OnServerEvent:Connect(function(player, HairName)
	
	local Hair = game.ServerStorage.PlayerAccesories.Hair
	local CosmeticStore = DataStore2("Cosmetics", player)
	local PlayerCosmetics = CosmeticStore:Get()
	
	if not Hair[HairName] then return end
	
	local CosmeticStore = DataStore2("Cosmetics", player)
	local BucksStore = DataStore2("Bucks", player)
	local productPrice = Hair[HairName].Price.Value

	if BucksStore:Get() >= productPrice and not PlayerCosmetics[HairName] then
		print("Buying product", HairName)
		BucksStore:Increment(-productPrice)
		table.insert(CosmeticStore,	Hair[HairName])
		CosmeticStore:Set(PlayerCosmetics)
	else
		return false
	end
end)

ReplicatedStorage.PlayerDataStoreEvents.ResetStatDebug.OnServerEvent:connect(function(plr)
	local userDatastore = DataStore2("Slot1Biometrics", plr)
	userDatastore:Set(nil)
end)

ReplicatedStorage.PlayerDataStoreEvents.Slot1Biometrics.OnServerEvent:Connect(function(player, character)
	
	local MinimumHeight = 0.95
	local HeightIncrement = 0.017

	local MinimumWeight = 0.7
	local WeightIncrement = 0.095
	
	local BiometricStore = DataStore2("Slot1Biometrics", player)
	local PlayerBiometrics = BiometricStore:Get({
		Height = MinimumHeight + HeightIncrement * math.random(1, 12),
		Weight = MinimumWeight + WeightIncrement * math.random(1, 3),
	})
	
	print(PlayerBiometrics.Height)
	print(PlayerBiometrics.Weight)
	
	local Humanoid = character:WaitForChild("Humanoid")
	
	Humanoid:WaitForChild("BodyHeightScale").Value = PlayerBiometrics.Height
	Humanoid:WaitForChild("BodyWidthScale").Value = PlayerBiometrics.Weight
	Humanoid:WaitForChild("BodyDepthScale").Value = PlayerBiometrics.Weight
end)

ReplicatedStorage.PlayerDataStoreEvents.Slot1SkinTone.OnServerEvent:Connect(function(player, SkinTone)
	
	local SkinToneStore = DataStore2("Slot1SkinTone", player)
	local PlayerSkinTone = SkinToneStore:Get()
	
	if not PlayerSkinTone then
		player["Body Colors"].HeadColor = SkinTone
		player["Body Colors"].LeftArmColor = SkinTone
		player["Body Colors"].RightArmColor = SkinTone
		player["Body Colors"].LeftLegColor = SkinTone
		player["Body Colors"].RightLegColor = SkinTone
		player["Body Colors"].TorsoColor = SkinTone
		table.insert(SkinToneStore, SkinTone)
		
		SkinToneStore:Set(PlayerSkinTone)
	else
		local SkinTone = SkinToneStore:Get(SkinTone)
		player["Body Colors"].HeadColor = SkinTone
		player["Body Colors"].LeftArmColor = SkinTone
		player["Body Colors"].RightArmColor = SkinTone
		player["Body Colors"].LeftLegColor = SkinTone
		player["Body Colors"].RightLegColor = SkinTone
		player["Body Colors"].TorsoColor = SkinTone
	end
end)


ReplicatedStorage.PlayerDataStoreEvents.Slot1FightingStyle.OnServerEvent:Connect(function(player, FightingStyle)
	
	local FightingStyleStore = DataStore2("Slot1FightingStyle", player)
	local PlayerFightingStyle = FightingStyleStore:Get()
	
	if not PlayerFightingStyle then
		table.insert(FightingStyleStore, FightingStyle)
		if FightingStyle == "Balanced" then
			
			player.IntValues.StatCaps.PowerStatCap = 15
			player.IntValues.StatCaps.SpeedStatCap = 15
			player.IntValues.StatCaps.ChinStatCap = 15
			player.IntValues.StatCaps.StaminaStatCap = 15
			
		else if FightingStyle == "Boxer Puncher" then
				
			player.IntValues.StatCaps.PowerStatCap = 12
			player.IntValues.StatCaps.SpeedStatCap = 20
			player.IntValues.StatCaps.ChinStatCap = 12
			player.IntValues.StatCaps.StaminaStatCap = 20
				
		else if FightingStyle == "Slugger" then
				
			player.IntValues.StatCaps.PowerStatCap = 20
			player.IntValues.StatCaps.SpeedStatCap = 13
			player.IntValues.StatCaps.ChinStatCap = 20
			player.IntValues.StatCaps.StaminaStatCap = 15
						
		else if FightingStyle == "Inside Figther" then
				
			player.IntValues.StatCaps.PowerStatCap = 18
			player.IntValues.StatCaps.SpeedStatCap = 17
			player.IntValues.StatCaps.ChinStatCap = 20
			player.IntValues.StatCaps.StaminaStatCap = 10
						
		else if FightingStyle == "Peakaboo" then
			player.IntValues.StatCaps.PowerStatCap = 20
			player.IntValues.StatCaps.SpeedStatCap = 18
			player.IntValues.StatCap.ChinStatCap = 12
			player.IntValues.StatCap.StaminaStatCap = 12		
				end
			end
		end
	end
	FightingStyleStore:Set(PlayerFightingStyle)			
end	
	else
		local FightingStyle = FightingStyleStore:Get(FightingStyle)
		if FightingStyle == "Balanced" then
			
			player.IntValues.StatCaps.PowerStatCap = 15
			player.IntValues.StatCaps.SpeedStatCap = 15
			player.IntValues.StatCaps.ChinStatCap = 15
			player.IntValues.StatCaps.StaminaStatCap = 15
			
		else if FightingStyle == "Boxer Puncher" then
				
			player.IntValues.StatCaps.PowerStatCap = 12
			player.IntValues.StatCaps.SpeedStatCap = 20
			player.IntValues.StatCaps.ChinStatCap = 12
			player.IntValues.StatCaps.StaminaStatCap = 20
				
		else if FightingStyle == "Slugger" then
				
			player.IntValues.StatCaps.PowerStatCap = 20
			player.IntValues.StatCaps.SpeedStatCap = 13
			player.IntValues.StatCaps.ChinStatCap = 20
			player.IntValues.StatCaps.StaminaStatCap = 15
						
		else if FightingStyle == "Inside Figther" then
				
			player.IntValues.StatCaps.PowerStatCap = 20
			player.IntValues.StatCaps.SpeedStatCap = 15
			player.IntValues.StatCaps.ChinStatCap = 20
			player.IntValues.StatCaps.StaminaStatCap = 10
						
		else if FightingStyle == "Peakaboo" then
			player.IntValues.StatCaps.PowerStatCap = 20
			player.IntValues.StatCaps.SpeedStatCap = 18
			player.IntValues.StatCap.ChinStatCap = 12
			player.IntValues.StatCap.StaminaStatCap = 12		
						end
					end
				end
			end
		end
	end
end)

ReplicatedStorage.PlayerDataStoreEvents.Slot1StatSet.OnServerEvent:Connect(function(player)
	
	local StatsStore = DataStore2("Slot1Stats", player)
	local PlayerStatsStore = StatsStore:Get()
	local ChinStat = player.IntValues.Chin
	local PowerStat = player.IntValues.Power
	local SpeedStat = player.IntValues.Speed
	local StaminaStat = player.IntValues.Stamina
	
	if not PlayerStatsStore then
		table.insert(PlayerStatsStore, ChinStat)
		table.insert(PlayerStatsStore, PowerStat)
		table.insert(PlayerStatsStore, SpeedStat)
		table.insert(PlayerStatsStore, StaminaStat)
		PlayerStatsStore:Set()
	else
		local SavedChinStat = PlayerStatsStore:Get(ChinStat)
		local SavedPowerStat = PlayerStatsStore:Get(PowerStat)
		local SavedSpeedStat = PlayerStatsStore:Get(SpeedStat)
		local SavedStaminaStat = PlayerStatsStore:Get(StaminaStat)
		
		ChinStat.Value = SavedChinStat.Value
		PowerStat.Value = SavedPowerStat.Value
		SpeedStat.Value = SavedSpeedStat.Value
		StaminaStat = SavedStaminaStat.Value
	end
end)

So, after some tinkering this is the script (pay attention to the biometric event). It creates the height/weight just fine but the issue is that it dosen’t save the height already generated and just keeps creating random heights. What I need it to do is create a random height/weight once, put in the datastore and then grab that height/weight. Now I’m wondering if it would be more effective to make a if statement or just make a whole new event dedicated to grabbing already saved heights. And I would test these on my own, however I don’t know how to see if the value is already in the store, thus why im editing this post. Thanks!

1 Like

if PlayerBiometrics = nil then should be if PlayerBiometrics == nil then.
(would cause syntax error if you use only single = in if statement)

Yeah I realised that and changed it, its the same issue regardless.

Add default values in BiometricStore:Get(). That way you’ll always have a value.

And why are you using table.insert on your DataStore2 table.insert(BiometricStore, PlayerHeight)?

Thats not how its supposed to be used? It’s my 1st time using this so I was kind of guessing on what to use to save the data. What would you do to save data? Also by deafult values do you mean “BiometricStore:Get(PlayerHeight)” for example?

image

It’s from the official Datastore2 tutorial. Basically the first argument of :Get will be the value if the players joins the game for the first time.

So how would I implement this for a random height/weight generation? Could I just have it as BiometricStore:Get(0)?

ReplicatedStorage.PlayerDataStoreEvents.Slot1Biometrics.OnServerEvent:Connect(function(player, character)
	local MinimumHeight = 0.95
	local HeightIncrement = 0.017

	local MinimumWeight = 0.88
	local WeightIncrement = 0.095
	
	local BiometricStore = DataStore2("Slot1Biometrics", player)
	local PlayerBiometrics = BiometricStore:Get({
		Height = MinimumHeight + HeightIncrement * math.random(1, 12),
		Weight = MinimumWeight + WeightIncrement * math.random(1, 12),
	})
	
	local Humanoid = character:WaitForChild("Humanoid")

	Humanoid.BodyHeightScale = PlayerBiometrics.Height
	Humanoid.BodyWidthScale = PlayerBiometrics.Weight
	Humanoid.BodyDepthScale = PlayerBiometrics.Weight
end)

here you should have some working code

Ok that looks good, also how would I get the values already saved in the biometric store? Would I just use PlayerBiometrics.Height?

Yes, use that.

1 Like

Oh uh, I was using the script and got a weird result. I ran the event and I printed out the player height/weight because my character became really small and it returned nil. Is this a issue with my math or is it a issue with the datastore?

I copied your code so might be worth checking out your math.

Hey, everything seems to be working well except that it dosen’t seem to be saving the height. Everytime I fire the event I get a new height/weight instead of the 1 I spawned the 1st time. I tried looking on the web for a answer but I didn’t find anything

DataStore2.Combine("DATA", "Slot1Biometrics")

ReplicatedStorage.PlayerDataStoreEvents.Slot1Biometrics.OnServerEvent:Connect(function(player, character)
	local MinimumHeight = 0.95
	local HeightIncrement = 0.017

	local MinimumWeight = 0.88
	local WeightIncrement = 0.095
	
	local BiometricStore = DataStore2("Slot1Biometrics", player)
	local PlayerBiometrics = BiometricStore:Get({
		Height = MinimumHeight + HeightIncrement * math.random(1, 12),
		Weight = MinimumWeight + WeightIncrement * math.random(1, 12),
	})
	
	local Humanoid = character:WaitForChild("Humanoid")

	Humanoid.BodyHeightScale = PlayerBiometrics.Height
	Humanoid.BodyWidthScale = PlayerBiometrics.Weight
	Humanoid.BodyDepthScale = PlayerBiometrics.Weight
end)

try combining Slot1Biometrics with DATA

I already had that down in another part of the script. Heres the full script.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")

local DataStore2 = require(script.DataStore2)

DataStore2.Combine("DATA", "Wins")
DataStore2.Combine("DATA", "Losses")
DataStore2.Combine("DATA", "Bucks")
DataStore2.Combine("DATA", "Cosmetics")
DataStore2.Combine("DATA", "Slot1Biometrics")
DataStore2.Combine("DATA", "Slot1SkinTone")
DataStore2.Combine("DATA", "Slot1FightingStyle")
DataStore2.Combine("DATA", "Slot1Stats")

Players.PlayerAdded:Connect(function(player)
	
	local WinStore = DataStore2("Wins", player)
	local LossStore = DataStore2("Losses", player)
	local BucksStore = DataStore2("Bucks", player)
	local CosmeticStore = DataStore2("Cosmetics", player)
	local Slot1BiometricStore = DataStore2("Slot1Biometrics", player)
	local Slot1SkinTone = DataStore2("Slot1SkinTone", player)
	local Slot1FightingStyle = DataStore2("Slot1FightingStyle", player)
	local Slot1StatsStore = DataStore2("Slot1Stats", player)

	local function GetWins(value)
		ReplicatedStorage.PlayerDataStoreEvents.Wins:FireClient(player, value)
	end
	
	local function GetLosses(value)
		ReplicatedStorage.PlayerDataStoreEvents.Losses:FireClient(player, value)
	end
	
	local function GetBucks(value)
		ReplicatedStorage.PlayerDataStoreEvents.Bucks:FireClient(player, value)
	end
	
	local function GetCosmetics(value)
		CosmeticStore:Set(value)
	end
	
	local function GetSlot1Biometrics(value)
		Slot1BiometricStore:Set(value)
	end
	
	local function GetSlot1SkinTone(value)
		Slot1SkinTone:Set(value)
	end
	
	local function GetSlot1FightingStyle(value)
		Slot1FightingStyle:Set(value)
	end
	
	local function GetSlot1Stats(value)
		Slot1StatsStore:Set(value)
	end

	GetWins(WinStore:Get())
	GetLosses(LossStore:Get())
	GetBucks(BucksStore:Get())
	GetSlot1Biometrics({})
	GetCosmetics({})
	GetSlot1SkinTone({})
	GetSlot1FightingStyle({})	
	GetSlot1Stats({})
	
	CosmeticStore:OnUpdate(GetCosmetics)
	Slot1FightingStyle:OnUpdate(GetSlot1FightingStyle)
	Slot1BiometricStore:OnUpdate(GetSlot1Biometrics)
	Slot1SkinTone:OnUpdate(GetSlot1SkinTone)	
	Slot1StatsStore:OnUpdate(GetSlot1Stats)
	WinStore:OnUpdate(GetWins)
	LossStore:OnUpdate(GetLosses)
	BucksStore:OnUpdate(GetBucks)
end)

-- This is a RemoteEvent where a player can purchase a product by its name.

ReplicatedStorage.PlayerDataStoreEvents.BuyItem.OnServerEvent:Connect(function(player, HairName)
	
	local Hair = game.ServerStorage.PlayerAccesories.Hair
	local CosmeticStore = DataStore2("Cosmetics", player)
	local PlayerCosmetics = CosmeticStore:Get()
	
	if not Hair[HairName] then return end
	
	local CosmeticStore = DataStore2("Cosmetics", player)
	local BucksStore = DataStore2("Bucks", player)
	local productPrice = Hair[HairName].Price.Value

	if BucksStore:Get() >= productPrice and not PlayerCosmetics[HairName] then
		print("Buying product", HairName)
		BucksStore:Increment(-productPrice)
		table.insert(CosmeticStore,	Hair[HairName])
		CosmeticStore:Set(PlayerCosmetics)
	else
		return false
	end
end)

ReplicatedStorage.PlayerDataStoreEvents.ResetStatDebug.OnServerEvent:connect(function(plr)
	local userDatastore = DataStore2("Slot1Biometrics", plr)
	userDatastore:Set(nil)
end)

ReplicatedStorage.PlayerDataStoreEvents.Slot1Biometrics.OnServerEvent:Connect(function(player, character)
	
	local MinimumHeight = 0.95
	local HeightIncrement = 0.017

	local MinimumWeight = 0.7
	local WeightIncrement = 0.095
	
	local BiometricStore = DataStore2("Slot1Biometrics", player)
	local PlayerBiometrics = BiometricStore:Get({
		Height = MinimumHeight + HeightIncrement * math.random(1, 12),
		Weight = MinimumWeight + WeightIncrement * math.random(1, 3),
	})
	
	print(PlayerBiometrics.Height)
	print(PlayerBiometrics.Weight)
	
	local Humanoid = character:WaitForChild("Humanoid")
	
	Humanoid:WaitForChild("BodyHeightScale").Value = PlayerBiometrics.Height
	Humanoid:WaitForChild("BodyWidthScale").Value = PlayerBiometrics.Weight
	Humanoid:WaitForChild("BodyDepthScale").Value = PlayerBiometrics.Weight
end)

ReplicatedStorage.PlayerDataStoreEvents.Slot1SkinTone.OnServerEvent:Connect(function(player, SkinTone)
	
	local SkinToneStore = DataStore2("Slot1SkinTone", player)
	local PlayerSkinTone = SkinToneStore:Get()
	
	if not PlayerSkinTone then
		player["Body Colors"].HeadColor = SkinTone
		player["Body Colors"].LeftArmColor = SkinTone
		player["Body Colors"].RightArmColor = SkinTone
		player["Body Colors"].LeftLegColor = SkinTone
		player["Body Colors"].RightLegColor = SkinTone
		player["Body Colors"].TorsoColor = SkinTone
		table.insert(SkinToneStore, SkinTone)
		
		SkinToneStore:Set(PlayerSkinTone)
	else
		local SkinTone = SkinToneStore:Get(SkinTone)
		player["Body Colors"].HeadColor = SkinTone
		player["Body Colors"].LeftArmColor = SkinTone
		player["Body Colors"].RightArmColor = SkinTone
		player["Body Colors"].LeftLegColor = SkinTone
		player["Body Colors"].RightLegColor = SkinTone
		player["Body Colors"].TorsoColor = SkinTone
	end
end)


ReplicatedStorage.PlayerDataStoreEvents.Slot1FightingStyle.OnServerEvent:Connect(function(player, FightingStyle)
	
	local FightingStyleStore = DataStore2("Slot1FightingStyle", player)
	local PlayerFightingStyle = FightingStyleStore:Get()
	
	if not PlayerFightingStyle then
		table.insert(FightingStyleStore, FightingStyle)
		if FightingStyle == "Balanced" then
			
			player.IntValues.StatCaps.PowerStatCap = 15
			player.IntValues.StatCaps.SpeedStatCap = 15
			player.IntValues.StatCaps.ChinStatCap = 15
			player.IntValues.StatCaps.StaminaStatCap = 15
			
		else if FightingStyle == "Boxer Puncher" then
				
			player.IntValues.StatCaps.PowerStatCap = 12
			player.IntValues.StatCaps.SpeedStatCap = 20
			player.IntValues.StatCaps.ChinStatCap = 12
			player.IntValues.StatCaps.StaminaStatCap = 20
				
		else if FightingStyle == "Slugger" then
				
			player.IntValues.StatCaps.PowerStatCap = 20
			player.IntValues.StatCaps.SpeedStatCap = 13
			player.IntValues.StatCaps.ChinStatCap = 20
			player.IntValues.StatCaps.StaminaStatCap = 15
						
		else if FightingStyle == "Inside Figther" then
				
			player.IntValues.StatCaps.PowerStatCap = 18
			player.IntValues.StatCaps.SpeedStatCap = 17
			player.IntValues.StatCaps.ChinStatCap = 20
			player.IntValues.StatCaps.StaminaStatCap = 10
						
		else if FightingStyle == "Peakaboo" then
			player.IntValues.StatCaps.PowerStatCap = 20
			player.IntValues.StatCaps.SpeedStatCap = 18
			player.IntValues.StatCap.ChinStatCap = 12
			player.IntValues.StatCap.StaminaStatCap = 12		
				end
			end
		end
	end
	FightingStyleStore:Set(PlayerFightingStyle)			
end	
	else
		local FightingStyle = FightingStyleStore:Get(FightingStyle)
		if FightingStyle == "Balanced" then
			
			player.IntValues.StatCaps.PowerStatCap = 15
			player.IntValues.StatCaps.SpeedStatCap = 15
			player.IntValues.StatCaps.ChinStatCap = 15
			player.IntValues.StatCaps.StaminaStatCap = 15
			
		else if FightingStyle == "Boxer Puncher" then
				
			player.IntValues.StatCaps.PowerStatCap = 12
			player.IntValues.StatCaps.SpeedStatCap = 20
			player.IntValues.StatCaps.ChinStatCap = 12
			player.IntValues.StatCaps.StaminaStatCap = 20
				
		else if FightingStyle == "Slugger" then
				
			player.IntValues.StatCaps.PowerStatCap = 20
			player.IntValues.StatCaps.SpeedStatCap = 13
			player.IntValues.StatCaps.ChinStatCap = 20
			player.IntValues.StatCaps.StaminaStatCap = 15
						
		else if FightingStyle == "Inside Figther" then
				
			player.IntValues.StatCaps.PowerStatCap = 20
			player.IntValues.StatCaps.SpeedStatCap = 15
			player.IntValues.StatCaps.ChinStatCap = 20
			player.IntValues.StatCaps.StaminaStatCap = 10
						
		else if FightingStyle == "Peakaboo" then
			player.IntValues.StatCaps.PowerStatCap = 20
			player.IntValues.StatCaps.SpeedStatCap = 18
			player.IntValues.StatCap.ChinStatCap = 12
			player.IntValues.StatCap.StaminaStatCap = 12		
						end
					end
				end
			end
		end
	end
end)

ReplicatedStorage.PlayerDataStoreEvents.Slot1StatSet.OnServerEvent:Connect(function(player)
	
	local StatsStore = DataStore2("Slot1Stats", player)
	local PlayerStatsStore = StatsStore:Get()
	local ChinStat = player.IntValues.Chin
	local PowerStat = player.IntValues.Power
	local SpeedStat = player.IntValues.Speed
	local StaminaStat = player.IntValues.Stamina
	
	if not PlayerStatsStore then
		table.insert(PlayerStatsStore, ChinStat)
		table.insert(PlayerStatsStore, PowerStat)
		table.insert(PlayerStatsStore, SpeedStat)
		table.insert(PlayerStatsStore, StaminaStat)
		PlayerStatsStore:Set()
	else
		local SavedChinStat = PlayerStatsStore:Get(ChinStat)
		local SavedPowerStat = PlayerStatsStore:Get(PowerStat)
		local SavedSpeedStat = PlayerStatsStore:Get(SpeedStat)
		local SavedStaminaStat = PlayerStatsStore:Get(StaminaStat)
		
		ChinStat.Value = SavedChinStat.Value
		PowerStat.Value = SavedPowerStat.Value
		SpeedStat.Value = SavedSpeedStat.Value
		StaminaStat = SavedStaminaStat.Value
	end
end)

The main part to pay attention to here is the Biometric Event the rest of the code is just mockups I have for stuff I plan to have in the game