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

cash on kill script and it does not show the leaderboard what did i do wrong?

Asked by 2 years ago
Edited by chess123mate 2 years ago
game.Players.PlayerAdded:Connect(function(player)
    local leaderstats = Instance.new("Folder",player)
    leaderstats.Name = "leaderstats"

    local cash = Instance.new("IntValue",leaderstats)
    cash.Name = "Cash"
    cash.Value = 0

    player.CharacterAdded:Connect(function(character)
        character.Humanoid.Died:Connect(function()
            local tag = character.Humanoid:FindFirstChild("creator")

            if tag ~= nil then
                local Award = 10
                local player = tag.Value

                local leaderstats = player:WaitForChild("leaderstats")
                leaderstats.Cash.Value = leaderstats.Cash.Value + Award
            end
        end)
    end)
end)


script.Disabled = true
0
Edited: Wrapped code in code block (you can do this by selecting the code and pressing the "Lua" button to the right of Bold/Italics/etc) chess123mate 5873 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

You disabled the script so the code wont run anymore

Ad

Answer this question