I am trying to make a script that if you kill the humanoid it is in, you’ll get exp from it. I dont know if i am using the “humanoid:FindFirstChild(“creator”)” right because the value that it finds is nil even if my player is the one to kill that dummy. My game has abillities so maybe thats causing it.
script
local humanoid = script.Parent:WaitForChild(“Humanoid”)
humanoid.Died:Connect(function()
local tag = humanoid:FindFirstChild("creator")
print(tag)
if tag ~= nil then
print("Works2")
local player = tag.Value
local Exp = 50
local Stats = player:WaitForChild("Stats")
Stats.Exp.Value = Stats.Exp.Value + Exp
end
end)
Gyazo
https://gyazo.com/c5d7bb5c1c696689a3066a1cb09e88c9
Script Location