Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OnCollisionCheck = function(self, other)
- local myDebug = false
- if not self:BeenDestroyed()then
- if IsProjectile(other) and not other:BeenDestroyed() and not IsAlly(self:GetArmy(), other:GetArmy()) then
- --WARN(repr(other:GetBlueprint().BlueprintId))
- local x, y, z = other:GetVelocity()
- x = Util.GetRandomFloat( (x * 0.990), (x * 1.010) )
- y = Util.GetRandomFloat( (y * 0.990), (y * 1.010) )
- z = Util.GetRandomFloat( (z * 0.990), (z * 1.010) )
- other.DamageData.DamageFriendly = true
- other.DamageData.DamageSelf = true
- local projBp = other:GetBlueprint().Source
- local proj = self:CreateChildProjectile(projBp)
- proj:SetVelocity(-x,-y,-z)
- proj:SetVelocity(Random(30, 60))
- proj:SetVelocityAlign(true)
- proj:TrackTarget(false)
- proj:SetLifetime(5)
- proj:PassDamageData(other.DamageData)
- other:Destroy()
- end
- end
- return false
- end,
Advertisement
Add Comment
Please, Sign In to add comment