Pet Hunger - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Pet Hunger (/Thread-Pet-Hunger) |
Pet Hunger - Van Glan Bloom - 05-11-2015 10:30 AM Good night people. I need your help in a script. I inserted a hunger system in pets, so that the player have to feed the animals periodically. However I can not achieve my goal. I wanted when the animal had less than 2 food he left the player and stay ownerless. Until now I have this Code: [function isfood] RE: Pet Hunger - XuN - 05-11-2015 05:27 PM http://wiki.sphere.torfo.org/index.php/@Hunger Right now the only check you have related is 'if (<food> <= 30)' which is far away from '2', then you can do something like 'damage 0,01,<owner>', this will make pet think owner damaged it ... so it will desert and do all default checks (unmount, update PetSlots,remove memories, etc). RE: Pet Hunger - Van Glan Bloom - 05-11-2015 10:55 PM Like this ?? Code: [ITEMDEF i_mem_pet_desert] Code: ON=@Hunger RE: Pet Hunger - XuN - 05-12-2015 02:36 AM No. First: @Hunger does not exists anymore, click the link I gave you. Second: serv.newitem=xxx doesn't place the item, you must equip it Third: <food> in @Timer will refer to the item, items doesn't have food, you must use <cont.food> and cont.damage Fourth: You don't need anything from serv.newitem or @timers, you only have to check in the @RegenStat trigger if <food> < 2 when argn1=3 RE: Pet Hunger - Van Glan Bloom - 05-12-2015 09:47 AM Thx Xun with your help i got it the script. =) One more question is possibly in @regenstat use some timer for the say something like : Exemple Code: on=@regenstat RE: Pet Hunger - XuN - 05-12-2015 05:00 PM timerf 30, emote something RE: Pet Hunger - Van Glan Bloom - 05-14-2015 10:57 PM It is possible to add an event to the player so that the animal stay with 0 food? Anything like that : Code: on=@RegenStat RE: Pet Hunger - XuN - 05-15-2015 04:49 AM http://wiki.sphere.torfo.org/index.php/@RegenStat Please read it... Food doesn't increase ... it decreases. You have 2 ways to achieve that with this trigger. |