added ability to protect npc's
This commit is contained in:
parent
75474b10be
commit
49d696eda4
1
igor.lua
1
igor.lua
@ -106,6 +106,7 @@ mobs:register_mob("mobs_npc:igor", {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
mobs:protect(self, clicker)
|
||||||
mobs:capture_mob(self, clicker, 0, 5, 80, false, nil)
|
mobs:capture_mob(self, clicker, 0, 5, 80, false, nil)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
3
npc.lua
3
npc.lua
@ -93,6 +93,9 @@ mobs:register_mob("mobs_npc:npc", {
|
|||||||
-- capture npc with net or lasso
|
-- capture npc with net or lasso
|
||||||
mobs:capture_mob(self, clicker, 0, 5, 80, false, nil)
|
mobs:capture_mob(self, clicker, 0, 5, 80, false, nil)
|
||||||
|
|
||||||
|
-- protect npc with mobs:protector
|
||||||
|
mobs:protect(self, clicker)
|
||||||
|
|
||||||
-- by right-clicking owner can switch npc between follow and stand
|
-- by right-clicking owner can switch npc between follow and stand
|
||||||
if self.owner and self.owner == name then
|
if self.owner and self.owner == name then
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user