function GameMode:OnEntityKilled( keys )
-- тут добавляй звуки, сообщения, эффекты - что хочешь
-- так воспроизводится звук
EmitGlobalSound("Diretide.Announcer.RoshanTarget.Radiant")
-- или так
EmitSoundOn( "Hero_SkeletonKing.CriticalStrike", params.target )
local attacker = EntIndexToHScript( keys.entindex_attacker )
local player = {}
-- получаем индекс атакующего
local attacker = EntIndexToHScript( keys.entindex_attacker )
-- если атакующий юнит-герой, то тогда получаем игрока-владельца
if attacker and attacker:IsRealHero() then
player = attacker:GetOwner()
end
-- получаем индекс убитого юнита
local killedUnit = EntIndexToHScript( keys.entindex_killed )
if killedUnit and player then
local data = {}
data.killedUnitName = killedUnit:GetUnitName()
-- отправляем данные в панораму
CustomGameEventManager:Send_ServerToPlayer(player, "my_event_name", data)
end
-- если есть barebones то можно вот так создать сообщение на экране
Notifications:TopToAll({text="Unit has been killed!!!", duration=3.0, style={marginTop='100px', color='red'}})
end