I'm a bit confused on how exactly I would do this. I have the rest of my DataStore fully functioning, but this is the only part I'm not so sure about.
local KDR = Instance.new("NumberValue", StatNumbers) KDR.Name = "KDR" if Kills.Value == 0 and Deaths.Value == 0 then KDR.Value = 0 elseif Kills.Value >= 0 and Deaths.Value > 0 then KDR.Value = Kills.Value/Deaths.Value elseif Kills.Value > 0 and Deaths.Value == 0 then KDR.Value = Kills.Value end
When I go to view my stats and the output, I get this number: -2147483648 I have my Kills set to 28 whilst my deaths are set to 3, so I was expecting a number around 9.3. What should I change to fix this?
You don't need to divide the kills by 0, so just put the kills.
local KDR = Instance.new("NumberValue", StatNumbers) KDR.Name = "KDR" if Kills.Value == 0 and Deaths.Value == 0 then KDR.Value = 0 elseif Deaths.Value > 0 then KDR.Value = Kills.Value/Deaths.Value else KDR.Value = Kills.Value end