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

Death Counter script interfering with Levels Script?

Asked by 4 years ago

I am currently making an obby. I added a death counter script, but I also had a levels script to show what level you are on. The levels script did not function properly when I added in the death counter script. Here is the script for the death counter:

ocal plrs = game.Players


plrs.PlayerAdded:Connect(function(plr)

    local stats = Instance.new("Folder")   
    stats.Name = "leaderstats"
    stats.Parent = plr

    local wipeouts = Instance.new("IntValue")  
    wipeouts.Name = "Wipeouts"
    wipeouts.Value = 0
    wipeouts.Parent = stats

    plr.CharacterAdded:Connect(function(char)

        local humanoid = char:FindFirstChild("Humanoid")

        humanoid.Died:Connect(function()

            wipeouts.Value = wipeouts.Value + 1

        end)       
    end)
end)

2 answers

Log in to vote
0
Answered by 4 years ago
local --TYPO
Ad
Log in to vote
0
Answered by
sprtony 20
4 years ago

Did you add the Level name as "Wipeouts"? Perhaps there is no error in the script, but the name is different, this causes the script to malfunction.

Answer this question