Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Exp script wont work?

I have a leaderstat named EXP and this script is meant to give EXP to you on a KO of another player, but I'm not sure why it won't work.

game.Players.PlayerAdded:connect(function(player) 
    player.CharacterAdded:connect(function(character) 
        local humanoid = character:WaitForChild("Humanoid") 
        humanoid.Died:connect(function() 
            for key, value in pairs(humanoid:GetChildren()) do 
                local killer = value.Value 
                if killer ~= nil then 
                    player.leaderstats.EXP.Value = (player.leaderstats.EXP.Value + 250)
                end 
            end 
        end) 
    end) 
end) 

1 answer

✓ Accepted answer

What is this:

local killer = value.Value

Do you have another script which creates a value in the players humanoid when they get hit?

2 comments

0

I'm going to work on the script a bit, so im just gonna mark the answer right.

0

Hahah ok.

This discussion is preserved as it was. New answers, comments, and votes are closed.