Гига Чадов
Ученик
(137),
на голосовании
2 недели назад
Пытаюсь сделать свою кастомку в дота 2 КАК СДЕЛАТЬ ОПЫТ В МИНУТУ???
if IshakiMode == nil then IshakiMode = class({}) end
function Precache( context )
end
-- Create the game mode when we activate function Activate() GameRules.AddonTemplate = IshakiMode() GameRules.AddonTemplate:InitGameMode() end
function IshakiMode:onThinkHero(hero) hero:AddExperience(100, DOTA_ModifyXP_Unspecified, false, true) PlayerResource:ModifyGold(hero:GetPlayerOwnerID(), 100, true, DOTA_ModifyGold_GameTick) end
function IshakiMode:InitGameMode() GameRules:GetGameModeEntity():SetThink("OnThink", self, 1) end
function IshakiMode:OnThink() if GameRules:State_Get() >= DOTA_GAMERULES_STATE_POST_GAME then return nil elseif GameRules:State_Get() ~= DOTA_GAMERULES_STATE_GAME_INPROGRESS then return 1 end
for , hero in pairs(HeroList:GetAllHeroes()) do self:onThinkHero(hero) end
КАК СДЕЛАТЬ ОПЫТ В МИНУТУ???
if IshakiMode == nil then
IshakiMode = class({})
end
function Precache( context )
end
-- Create the game mode when we activate
function Activate()
GameRules.AddonTemplate = IshakiMode()
GameRules.AddonTemplate:InitGameMode()
end
function IshakiMode:onThinkHero(hero)
hero:AddExperience(100, DOTA_ModifyXP_Unspecified, false, true)
PlayerResource:ModifyGold(hero:GetPlayerOwnerID(), 100, true, DOTA_ModifyGold_GameTick)
end
function IshakiMode:InitGameMode()
GameRules:GetGameModeEntity():SetThink("OnThink", self, 1)
end
function IshakiMode:OnThink()
if GameRules:State_Get() >= DOTA_GAMERULES_STATE_POST_GAME then
return nil
elseif GameRules:State_Get() ~= DOTA_GAMERULES_STATE_GAME_INPROGRESS then
return 1
end
for , hero in pairs(HeroList:GetAllHeroes()) do
self:onThinkHero(hero)
end
return 1
end
не понимаю почему у меня не работает код