I've had 2 of this same questions in different forums and no one can figure why it doesn't work. I have a basic roblox dummy in the workspace and it has a humanoid and everything. So When I Kill the Dummy the GiveExp Script says {xp is not a valid member of Folder}, here is the scripts.
----Leaderstats Script(Normal Script)----
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder")
leaderstats.Parent = plr
leaderstats.Name = "Leaderstats"
local lvl = Instance.new("IntValue")
lvl.Parent = leaderstats
lvl.Name = "Level"
local xp = Instance.new("IntValue")
xp.Parent = leaderstats
xp.Name = "Exp"
end)
----GiveExp Script (Normal Script)----
local leaderstats = game.Players.LocalPlayer:WaitForChild("Leaderstats")
game.Workspace.Dummy.Humanoid.Died:Connect(function()
leaderstats.Exp.Value = leaderstats.xp.Value + 10000
end)
I've have asked this so many times and no brilliant mind can figure this out, could somebody take the time to help this old lad?

3 comments
Could you show the code that I should change/fix?
For your script to work, you'd have to create another script which detects which player killed it and such, which I don't have time for right now, sorry.
*and after you have the payer, copy your give xp script but fix the things I pointed out.