So i have a Leaderstat Called "Exp" but in the scripts its "EXP" im not sure if that matters but, The Exp on kill script doesnt work at all? Any help?
Exp on kill script:
game.Players.PlayerAdded:connect(function(player)
local folder = Instance.new("Folder",player)
folder.Name = "leaderstats"
local currency1 = Instance.new("IntValue",folder)
currency1.Name = "EXP"
player.CharacterAdded:connect(function(character)
character:WaitForChild("Humanoid").Died:connect(function()
local tag = character.Humanoid:FindFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
currency1.Value = currency1.Value + 300
end
end
end)
end)
end)
I also want a Exp over time script (for all players in the server) but my current script wouldnt work.
Exp over time script:
amount = 5
timedelay = 0.5
currencyname = "EXP"
while true do
wait(timedelay)
for i,v in pairs(game.Players:GetPlayers()) do
if v:FindFirstChild("leaderstats") then
v.leaderstats[currencyname].Value = v.leaderstats[currencyname]. Value + amount
end
end
end

1 comment
I think your scripts needs to make sure that when you kill someone that it there is a string value named creator in order for it to work