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

Can anyone fix my LeaderBoard Error?

Asked by 9 years ago
local C = {}

function saveScore(player, score, name)
    player:SaveNumber(name, score)
end
function ADDSTUFF(Ply)

    local Dis = Instance.new("NumberValue", Ply)
    Dis.Name = "District"

    local InA = Instance.new("BoolValue", Ply)
    InA.Name = "InArena"
    local InA2 = Instance.new("BoolValue", Ply)
    InA2.Name = "InArena2"

    local Hunger = Instance.new("NumberValue", Ply)
    Hunger.Name = "Hunger"
    Hunger.Value = 100
    local Thirst = Instance.new("NumberValue", Ply)
    Thirst.Name = "Thirst"
    Thirst.Value = 100
    local Exp = Instance.new("NumberValue", Ply)
    Exp.Name = "Exp"
    local Lvl = Instance.new("NumberValue", Ply)
    Lvl.Name = "Lvl"
    Lvl.Value = 1
    local Points = Instance.new("NumberValue", Ply)
    Points.Name = "Points"
    Points.Value = 0

    local TiG = Instance.new("NumberValue", Ply)
    TiG.Name = "TimeInGame"

    local Age = Instance.new("StringValue", Ply)
    Age.Name = "Age"
    Age.Value = "Unknown"
    local Gender = Instance.new("StringValue", Ply)
    Gender.Name = "Gender"
    Gender.Value = "Unknown"

    local FoodMessage = Instance.new("StringValue", Ply)
    FoodMessage.Name = "FoodMessage"
    local LevelMessage = Instance.new("StringValue", Ply)
    LevelMessage.Name = "LevelMessage"

    local A = game.Lighting.Info:Clone()
    A.Parent = Ply.PlayerGui

    Ply:WaitForDataReady()
    Exp.Value = Ply:LoadNumber("ExpSave")
    Lvl.Value = Ply:LoadNumber("LvlSave")
end

function onPlayerRemoving(player)
        for a,v in pairs(shared.Tributes) do
            if v == player then
            table.remove(shared.Tributes,a)
        end
    end
    local exp = player:findFirstChild("Exp")
    local lvl = player:findFirstChild("Lvl")
    if exp then saveScore(player, exp.Value, "ExpSave") end
    if lvl then saveScore(player, lvl.Value, "LvlSave") end
end

delay(0, function()
        while true do
        wait()
            for A,B in pairs(game.Players:GetChildren()) do
                if not B:findFirstChild("InArena") then
                ADDSTUFF(B)
            end
        end
    end
end)
game.Players.PlayerRemoving:connect(onPlayerRemoving)

Error on line 7, and 65.

0
Anything in the output? woodengop 1134 — 9y
0
What is the problem exactly? How is it not working? Was there any Output? If so, what did it say? These Questions are important so that you can get a legitimate Answer, and to prepare us to help you with your problem (Answer your Question, in other words). TheeDeathCaster 2368 — 9y
0
:o a hunger games?? FutureWebsiteOwner 270 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Possibly remove the space on line 7.

0
I will try IIxWhiteRobotxII 0 — 9y
0
White space do not cause errors, unless if there's an ambiguous syntactical error. But in this case, the white space is fine. Redbullusa 1580 — 9y
0
What else could cause the error on line 7? Lazynathaniel 10 — 9y
0
White space doesn't really matter in Lua (except for the ones between words!!), you can technically cram many parts of this into 1 line without error. alphawolvess 1784 — 9y
Ad

Answer this question