This script is supposed to tell you your KDR (meaning the value has to be a NumberValue). However, I want to the script to identify when the KDR is "NAN" or "INF" and say something different for the values in that case (0 and the amount of kills you have respectively)
Output is giving me nothing. I have no idea why the script isn't working.
Can someone please help me?
Here's the script:
local Player = game.Players.LocalPlayer
local Stats = Player.leaderstats
local Div = (Stats.Kills.Value/Stats.Deaths.Value)
local Number = 0
while wait (0.1) do
if Div == "INF" and Stats.Kills.Value > 0 then
Number.Value = Stats.Kills.Value
elseif Number == "NAN" and Stats.Kills.Value == 0 and Stats.Deaths.Value == 0 then
Number.Value = 0
end
end
while wait(0.1) do
if Player ~= nil then
if Stats ~= nil then
local Number = (Stats.Kills.Value/Stats.Deaths.Value)
wait(0.1)
script.Parent.Text = "Ratio: "..Number..""
end
end
end

1 comment
Thank you! It works!