Пытаюсь приручить крипа, но он отказывается выполнять "приказы", контрол сделал, не понимаю, чего не хватает?
Код:
local caster = self:GetCaster()
local target = self:GetCursorTarget()
local health = self:GetSpecialValueFor("health")
local speed = self:GetSpecialValueFor("speed")
if not self.dominated_units then
self.dominated_units = {}
end
for k,v in pairs(self.dominated_units) do
if v and IsValidEntity(v) then
v:ForceKill(false)
end
end
self.dominated_units = {}
table.insert(self.dominated_units, target)
target:AddNewModifier(caster, self, "modifier_kill", {duration = self:GetSpecialValueFor("duration")})
target:SetControllableByPlayer(caster:GetEntityIndex(),true)
--[[target:SetOwner(caster)]]--
target:SetTeam(caster:GetTeamNumber())
if target:GetMaxHealth() < health then
print("Set Health to "..health)
target:SetMaxHealth(health)
end
if target:GetBaseMoveSpeed() < speed then
print("Set Movespeed to "..speed)
target:SetBaseMoveSpeed(speed)
end
Последнее редактирование модератором: