local _M = require(script.Parent.MobConfig)
local Mob = script.Parent
local Enemy = Mob.Enemy
Enemy.Died:Connect(function()
if (not Enemy:FindFirstChild("creator")) then return end
local tag = Enemy.creator
local player = game.Players:GetPlayerFromCharacter(tag.Value)
local Stats = player:WaitForChild("leaderstats")
local XP = Stats:WaitForChild("XP")
local Gold = Stats:WaitForChild("Gold")
XP.Value = XP.Value + _M.XPAward
Gold.Value = Gold.Value + _M.GoldAward
end)
the error in output:
Workspace.Bald Gang Member(lvl 5).RewardScript:8: attempt to index local 'player' (a nil value)

3 comments
tag.Value is not a player's character
Enemy is the humanoid
Ik, enemy is humanoid.