So I’m trying to make a player build system for a boxing game. Currently I’m looking mainly for a time save/efficent way of changing the stats based on the players biometrics (height/weight). For example say if a players weight is 0.95 (body depth scale/body weight scale) then his chin and power stats will go up while his speed and stamina will drop, vice versa for lower weights and higher weights
ReplicatedStorage.PlayerDataStoreEvents.Slot1FightingStyle.OnServerEvent:Connect(function(player, FightingStyle)
local FightingStyleStore = DataStore2("Slot1FightingStyle", player)
local FightingStyle = FightingStyle.Value
local Slot1ChinStat = DataStore2("Slot1ChinStat", player)
local Slot1PowerStat = DataStore2("Slot1PowerStat", player)
local Slot1SpeedStat = DataStore2("Slot1SpeedStat", player)
local Slot1StaminaStat = DataStore2("Slot1StaminaStat", player)
if player.PlayerBiometrics.Weight.Value >0.93 then
local WeightMultiplier = player.PlayerBiometrics.Weight.Value*2
else
local WeightMultiplier = Player.PlayerBiometrics.Weight.Value*1
end
if FightingStyle == "Balanced" then
Slot1ChinStat:Set(15)
Slot1SpeedStat:Set(15)
Slot1PowerStat:Get(15)
Slot1StaminaStat:Get(15)
else if FightingStyle == "Boxer Puncher" then
Slot1ChinStat:Set(12)
Slot1SpeedStat:Set(20)
Slot1PowerStat:Get(12)
Slot1StaminaStat:Get(20)
else if FightingStyle == "Slugger" then
Slot1ChinStat:Set(18)
Slot1SpeedStat:Set(13)
Slot1PowerStat:Get(20)
Slot1StaminaStat:Get(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)
Please excuse the messy code I’m in the middle of re-working it (I’m using datastore 2 so ignore the last 3 fighting styles)