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?

2 comments
This is an integer underflow. I would assume it's something to do with the value of Deaths being 0.
Yeah I understand that, but I'm just confused because what if you have 1 kill and 0 deaths? The KDR should be 1 and I have no idea on how to get the program to understand that. Just like how any normal KDR is; Kills divided by Deaths.