The script below is a leaderstats script that has 3 stats. Kills, Deaths, and K/D. My goal is to make the K/D value display the ratio, so if you have 1 kill 2 deaths it is 0.5. Right now when you have 1 kill 2 deaths, it rounds the ratio to 1. How would I stop it from rounding?
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder")
local Kills = Instance.new("IntValue")
local Deaths = Instance.new("IntValue")
local Ratio = Instance.new("IntValue")
leaderstats.Name = "leaderstats"
Kills.Name = "Kills"
Deaths.Name = "Deaths"
Ratio.Name = "K/D"
Kills.Value = 0
Deaths.Value = 0
Ratio.Value = 0
Kills.Parent = leaderstats
Deaths.Parent = leaderstats
Ratio.Parent = leaderstats
leaderstats.Parent = plr
while true do
wait(.1)
if Deaths.Value ~= 0 then
Ratio.Value = Kills.Value/Deaths.Value
else
Ratio.Value = Kills.Value
end
end
end)