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

KDR script isn't calculating the ratio, what's wrong with it?

Asked by 6 years ago
Edited 6 years ago

My script isn't calculating the ratio. I don't think it's even doing anything. I can't figure out what's wrong with it. It's supposed to divide the amount of kills by the amount of deaths a player has.

timedelay = 0.5

while true do
    wait(timedelay)
    for i,v in pairs(game.Players:GetPlayers()) do
        if v:FindFirstChild("KillsAndDeaths") then
            v.KillsAndDeaths.KDR.Value = v.KillsAndDeaths.Kills.Value/v.KIllsAndDeaths.Deaths.Value
        end
    end
end
1
Could be an assortment of problems. Is "KDR" a NumberValue? An IntegerValue will round when setting it to a decimal. Are the calculations actually being made? Test this by printing out the quotient. You should also choose another time to update the KDR rather than a loop, such as when a player's Kills/Deaths change. PreciseLogic 271 — 6y
0
Thank you, I'll take what you said into consideration and test them out. Michael_TheCreator 166 — 6y

Answer this question