Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a reason why my k/d ratio isn't working? Error: Value says nil when game is ran.

Asked by 5 years ago
game.Players.PlayerAdded:Connect(function(Player)
local kdratio = Instance.new("NumberValue",Player)
kdratio.Name = "KillDeath"
local leader = Player:WaitForChild("leaderstats")
local ratio = leader:WaitForChild("Deaths").Value / leader:WaitForChild("Deaths").Value
local finalratio = math.floor(ratio * 100)/100
kdratio.Value = finalratio
end) 
0
from which line is error coming? starmaq 1290 — 5y
0
There is no error it just comes up with NAN Afraid4Life 5 — 5y

Answer this question