Hi, everybody.How can I make a summoned unit give gold to its owner for killing creeps?
I tried to do something like this, but print(gold_modify) returns 0
GameEvent entity_killed:
if attacker:GetUnitName() == "npc_dota_goodguys_siege_custom" or attacker:GetUnitName() == "npc_dota_neutral_satyr_trickster_custom" or attacker:GetUnitName() == "npc_dota_neutral_warpine_raider_custom" then
local bounty_min = killed_unit:GetMinimumGoldBounty()
local bounty_max = killed_unit:GetMaximumGoldBounty()
local owner_id = attacker:GetPlayerOwnerID()
print(owner_id)
if owner_id then
local random_bounty = RandomInt(bounty_min,bounty_max)
print(random_bounty)
local gold_modify = PlayerResource:ModifyGold(owner_id, random_bounty, false, DOTA_ModifyGold_Unspecified)
print(gold_modify)
end
end