hi i have problem with 2 exp everything work but i have problem with reward from npc they kill that npc script reward
local Enemy = script.Parent.Humanoid
function KillForXp()
local nume = 100
local tag = Enemy:findFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local Data = tag.Value:findFirstChild("Data")
local leader = tag.Value:FindFirstChild("Quest")
if leader.Num.Value == script.Parent.Data.Num.Value then
if leader ~= nil then
leader.Kills.Value = leader.Kills.Value + 1
end
end
if Data ~= nil then
if Data.Expx2.Value < 0 then
Data.Exp.Value += nume
elseif Data.Expx2.Value > 0 then
Data.Exp.Vaule += (nume * 2)
wait(0.01)
script:Destroy()
end
end
end
end
Enemy.Died:connect(KillForXp)
end