Solved Code Structure Issue and Horse Not Removing itself

Discussion in 'Plugin Development' started by itscxlkq, Jun 10, 2019.

  1. Offline

    itscxlkq

    [​IMG]
    [​IMG]

    I've done this, but it's not functioning properly. The horse is being created but it doesn't delete the previous one and work how it's supposed to. Anyone able to help?
     
  2. Offline

    timtower Ninja on the waves Moderator

  3. Offline

    itscxlkq

    Still no better. The horses spawn, then when toggling it again so they get removed only the every second one gets removed, so in the end there's horses that don't belong.
    New code:
    [​IMG]
    [​IMG]
     
  4. Offline

    timtower Ninja on the waves Moderator

    @itscxlkq 1. Please use code blocks instead of images.
    2. Then why do you spawn a horse BEFORE you check if the horse should be added / removed?
     
  5. Offline

    itscxlkq

    1. Got it.
    2. I'm afraid I don't understand. The horse is being spawned after checking if the player already has a hashmap linked with another horse. If not we spawn one, if they do we'll get rid of their other one. My method of toggling horse on or off.
     
  6. Offline

    timtower Ninja on the waves Moderator

    You spawn the horse after the item check, before the activePet check.
     
  7. Offline

    itscxlkq

    @timtower
    Thanks for pointing that out. I've fixed the issue.
     

Share This Page