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

Why is this script that is suposed to continuously update a leaderstat not working?

Asked by 8 years ago

This script is supposed to continuously update a player's Ratio value based on their kills and deaths.

However, the script doesn't work, and output gave me nothing.

Can someone please help me?

Here's the script:

local Player = game.Players.LocalPlayer
local stats = Player:WaitForChild("leaderstats")

while wait(0.1) do
    if Player ~= nil then
        if stats ~= nil then
            stats.Ratio.Value = (stats.Kills.Value/math.max(1,stats.Deaths.Value))
        end
    end
end
0
Hieee!! I'M REXBIT'S LIL BRUDDA... GET ME SUSPENDED PLZZZ rexbit 707 — 8y
1
put a print on line 3, and if it doesn't print, then the :WaitForChild() is waiting forever theCJarmy7 1293 — 8y

Answer this question