you need to feed pets to tame them

This commit is contained in:
cale 2016-04-10 11:51:52 +02:00
parent 990e02d948
commit 4b45fc42c1
2 changed files with 12 additions and 5 deletions

View File

@ -34,11 +34,17 @@ function pets.register_pet(name, def)
if pets.players_pets[clicker:get_player_name()] then
cmsg.push_message_player(clicker, "[pet] You already have a pet!")
else
pets.players_pets[clicker:get_player_name()] = name
cmsg.push_message_player(clicker, "[pet] + ".. def.description)
self.pl = clicker
pets.players_pets[clicker:get_player_name()] = name
pets.save_pets()
if clicker:get_wielded_item():get_name() == (def.food or "farming:wheat_seeds") then
local wielded_item = clicker:get_wielded_item()
wielded_item:take_item()
clicker:set_wielded_item(wielded_item)
pets.players_pets[clicker:get_player_name()] = name
cmsg.push_message_player(clicker, "[pet] + ".. def.description)
self.pl = clicker
pets.players_pets[clicker:get_player_name()] = name
pets.save_pets()
end
end
end,

View File

@ -8,4 +8,5 @@ pets.register_pet("wolf:wolf", {
walk = {x=80, y=100},
sit = {x=0, y=80}
},
food = "fishing:fish",
})