1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Need help to an bee that i'm riding attacks player

Discussion in 'Skript' started by angrybeezz, May 31, 2022.

Thread Status:
Not open for further replies.
  1. angrybeezz

    angrybeezz Member

    Joined:
    May 31, 2022
    Messages:
    4
    Likes Received:
    0
    Hello, i'm into a problem and i don't know what to do, i want to make a bee that i'm riding attack the monster/player that attacks me, this is the code:

    ------------------------------------------------------------

    on right click on bee:
    if {game::%player%} is equal to 1:
    make player ride clicked entity

    on damage:
    if victim is riding a bee:
    make victim's vehicle target attacker

    ------------------------------------------------------------

    Plugins:
    Skbee

    Note: If i need to install another plugin to solve this problem make it very clearly.
     
  2. Mich

    Mich Active Member

    Joined:
    Jul 15, 2020
    Messages:
    148
    Likes Received:
    5
    Code (Text):
    1. #try this
    2. on damage:
    3.     if victim is riding a bee:
    4.     while attacker is alive:
    5.         make victim's vehicle target attacker
    6.         if distance between victim's vehicle and attacker is less than 10:
    7.             wait a tick
    8.             if distance between victim's vehicle and attacker is less than 1:
    9.                 damage the attcker by 1 heart
    10.                 push attacker upwards with force 0.5
    11.                 push attacker backwards with force 0.5
    12.                 wait 1 second
    13.         else:
    14.             exit loop
     
  3. angrybeezz

    angrybeezz Member

    Joined:
    May 31, 2022
    Messages:
    4
    Likes Received:
    0
    Your code didn't worked, but i found a way to solve my problem, i'm going to close the discussion now.

    The code:


    on right click on bee:
    make player ride clicked entity

    on damage:
    if victim is riding a bee:
    loop all bees in radius 2 of victim:
    if victim is riding loop-entity:
    set loop-entity's target to attacker
     
Thread Status:
Not open for further replies.

Share This Page

Loading...