Это в гейм мод писать? Я просто в этом 0). Можешь чуть подробней?Где-нибудь в InitGameMode
GameRules:GetGameModeEntity():SetTPScrollSlotItemOverride("item_blink")
Просто дать его при спавне герояМожно сделать так что бы блин сразу там был?
function название_мода:InitGameMode()
---------------------------------------------------------------------------
GameRules:GetGameModeEntity():SetTPScrollSlotItemOverride("item_blink")
ListenToGameEvent("npc_spawned", Dynamic_Wrap(self, 'OnUnitSpawned'), self)
---------------------------------------------------------------------------
end
function название_мода:OnUnitSpawned(event)
local hHero = EntIndexToHScript(event.entindex)
if hHero and hHero:IsRealHero() and not hHero.bSpawned then
hHero:AddItem("item_blink")
-- если хочешь чтобы свитки телепортации удалялись раскомментируй строки ниже
-- local hTpScroll = hHero:FindItemInInventory("item_tpscroll")
-- if hTpScroll then hHero:RemoveItem(hTpScroll) end
hHero.bSpawned = true
end
end
function CAddonTemplateGameMode:InitGameMode()
---------------------------------------------------------------------------
GameRules:GetGameModeEntity():SetTPScrollSlotItemOverride("item_blink")
ListenToGameEvent("npc_spawned", Dynamic_Wrap(self, 'OnUnitSpawned'), self)
---------------------------------------------------------------------------
end
function CAddonTemplateGameMode:OnUnitSpawned(event)
local hHero = EntIndexToHScript(event.entindex)
if hHero and hHero:IsRealHero() and not hHero.bSpawned then
hHero:AddItem("item_blink")
-- если хочешь чтобы свитки телепортации удалялись раскомментируй строки ниже
local hTpScroll = hHero:FindItemInInventory("item_tpscroll")
if hTpScroll then hHero:RemoveItem(hTpScroll)
end
hHero.bSpawned = true
end
end
Timers:CreateTimer(
1,
function()
local hTpScroll = hHero:FindItemInInventory("item_tpscroll")
if hTpScroll then hHero:RemoveItem(hTpScroll) end
end
)
GameRules:GetGameModeEntity():SetTPScrollSlotItemOverride("item_blink")
Timers:CreateTimer(
1,
function()
local hTpScroll = hHero:FindItemInInventory("item_tpscroll")
if hTpScroll then hHero:RemoveItem(hTpScroll) end
end
)