I want it so when a player kills this mob, the mob will drop random amount of gold between the min and max value of gold that can be dropped from that mob. Here is the script.
local _M = require(script.Parent.MobConfig)
local Mob = script.Parent
local Enemy = Mob.Enemy
function Award()
if (Mob == nil) or (Enemy == nil) then return end
if (not Enemy:FindFirstChild("Player_Tag")) then return end
local Tag = Enemy:FindFirstChild("Player_Tag")
if (not Tag) and (not Tag.Value) then return end
local plr = Tag.Value
if (not plr:FindFirstChild("leaderstats")) then return end
local stats = plr:FindFirstChild("leaderstats")
if (not stats:FindFirstChild("XP")) then return end
if (not stats:FindFirstChild("Gold")) then return end
wait(0.1)
if script.FinalHitTrue.Value == true then
stats.XP.Value = stats.XP.Value + _M.AwardedXP
stats.Gold.Value = stats.Gold.Value + _M.AwardedGold
end
end
Enemy.Died:Connect(Award)
