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

Exp script wont work?

Asked by 8 years ago

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

Log in to vote
0
Answered by 8 years ago

What is this:

local killer = value.Value

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

0
I'm going to work on the script a bit, so im just gonna mark the answer right. kelimeguy 60 — 8y
0
Hahah ok. MaskedVoid 15 — 8y
Ad

Answer this question