function Game.Rule:OnTakeDamage (victim, attacker, damage, weapontype, hitbox)
if victim.user.OnHit then victim.user.OnHit(victim, attacker, damage, weapontype, hitbox) end
end
function button01:OnUse(player)
local monnexon Game.Monster:Create(201, {x=10,y=10,z=2})
monster.user.onnexon function (monster, attacker, damage, weapontype, hitbox)
local Attacker = attacker:ToPlayer() or nil
local Monnexon monster:ToMonster() or nil
if Attacker == nil then return end
if math.abs(attacker.position.x - Monster.position.x) >= 2 then
Monster.velocity = {x=(attacker.position.x - Monster.position.x) * 100, y=y,z=z}
end
if math.abs(attacker.position.y - Monster.position.y) >= 2 then
Monster.velocity = {x=x,y=(attacker.position.y - Monster.position.y) * 100,z=z}
end
end
end