Whenever I kill this npc, it won't give me exp. I think something is wrong with my weapon?.
So, I'm a pretty new scripter and im making a script where the player kills an npc, he or she gains Exp and that exp can used to lvl up and unlock new fighting styles which hit more and harder, I feel like the problem is my weapon because it is a combat weapon that has fighting moves and animations and all that a combat system has, how would I make this script work for the player so when they kill the npc, they gain Exp
01 | local Humanoid = script.Parent.Humanoid |
04 | local tag = Humanoid:FindFirstChild( "creator" ) |
06 | if tag.Value ~ = nil then |
07 | local leaderstats = tag.Value:FindFirstChild( "leaderstats" ) |
08 | if leaderstats ~ = nil then |
09 | leaderstats.Exp.Value = leaderstats.Exp.Value + 10 |
16 | Humanoid.Died:Connect(Dead) |