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
local Humanoid = script.Parent.Humanoid
function Dead()
local tag = Humanoid:FindFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local leaderstats = tag.Value:FindFirstChild("leaderstats")
if leaderstats ~= nil then
leaderstats.Exp.Value = leaderstats.Exp.Value + 10
wait(0.1)
script:Remove()
end
end
end
end
Humanoid.Died:Connect(Dead)

1 comment
Nope, that didn't help