How To Get Exp When A Humanoid Dies?
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)----
01 | game.Players.PlayerAdded:Connect( function (plr) |
02 | local leaderstats = Instance.new( "Folder" ) |
03 | leaderstats.Parent = plr |
04 | leaderstats.Name = "Leaderstats" |
06 | local lvl = Instance.new( "IntValue" ) |
07 | lvl.Parent = leaderstats |
10 | local xp = Instance.new( "IntValue" ) |
11 | xp.Parent = leaderstats |
----GiveExp Script (Normal Script)----
1 | local leaderstats = game.Players.LocalPlayer:WaitForChild( "Leaderstats" ) |
3 | game.Workspace.Dummy.Humanoid.Died:Connect( function () |
4 | leaderstats.Exp.Value = leaderstats.xp.Value + 10000 |
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?