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.

health Crystal

Discussion in 'Skript' started by KawaiiKitsune, Aug 19, 2018.

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

    KawaiiKitsune Member

    Joined:
    Aug 19, 2018
    Messages:
    14
    Likes Received:
    1
    I am now working on making a health crystal. what I am stuck with now is if I do rightclick that player must heal and I get damage the amount of heal that I give. how can I do that best?


    Code (Skript):
    1. command /hc:
    2.     trigger:
    3.         give player 1 red dye of protection 5 named "&5health crystal"
    4.  
    5. on right click with red dye:
    6.     heal the player
     
  2. Aidanete

    Aidanete Active Member

    Joined:
    Apr 11, 2017
    Messages:
    139
    Likes Received:
    10
    Code (Skript):
    1. on rightclick:
    2. player's tool is red dye named "&5Health Crystal":
    3. heal the player by 5 hearts
    4. damage the player's tool by 5
    5.  
    I think this will work but I'm not sure
    You should use an item that can receive damage or something like that.
     
  3. KawaiiKitsune

    KawaiiKitsune Member

    Joined:
    Aug 19, 2018
    Messages:
    14
    Likes Received:
    1
    it is not possible that I get damage and that another player gets the heal
     
  4. Dabriel

    Dabriel Member

    Joined:
    Aug 13, 2018
    Messages:
    45
    Likes Received:
    5
    it might be possible, but it will be complex.
     
  5. jaylawl

    jaylawl Active Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    31
    Code (Skript):
    1. on right click on player holding red dye:
    2.     heal the event-entity by 5
    3.     damage event-player by 5
     
  6. Dabriel

    Dabriel Member

    Joined:
    Aug 13, 2018
    Messages:
    45
    Likes Received:
    5
    Oof I was trying to make it, it was so complex for me. I even decided to use Skript-mirror.

    and it's that simple.... damn. You are skilled
     
  7. jaylawl

    jaylawl Active Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    31
    nah i know the feeling... i tend to overthink things at times too
     
  8. Ofus

    Ofus Member

    Joined:
    Mar 28, 2018
    Messages:
    26
    Likes Received:
    3
    Hi i'm bored so I decided to do unnecessary stuff

    Code (Skript):
    1. command /hc:
    2.   trigger:
    3.     give player 1 red dye of protection 5 named "&5Health Crystal" # with lore "&dHeal a player by right clicking on them"
    4.  
    5. # One time use
    6. on right click on player holding red dye:
    7.   if name of player's tool = "&5Health Crystal":
    8.     remove 1 of player's tool from player's tool # Supports item stacking
    9.     heal the event-entity by 5
    10.     damage event-player by 5
    11.     send "&5You have healed &d%event-entity% &5using a &dhealth crystal"
    12.     send "&5You have been healed by &d%player%" to event-entity
    13.  
    14. # Cooldown:
    15. on right click on player holding red dye:
    16.   if name of player's tool = "&5Health Crystal":
    17.     set {_waited} to difference between {healthCrystal::%player%} and now
    18.     if {_waited} is less than 30 seconds:
    19.       send "&cYou are still on cooldown &7(%difference between 30 seconds and {_waited}%)"
    20.     else:
    21.       heal the event-entity by 5
    22.       damage event-player by 5
    23.       send "&5You have healed &d%event-entity% &5using a &dhealth crystal"
    24.       send "&5You have been healed by &d%player%" to event-entity
    25.       set {healthCrystal::%player%} to now
    26.  
    27. # If using with lore expression within the command
    28. expression %itemtype% with lore %string%:
    29.     return type: itemtype
    30.     get:
    31.         set {_item} to expression-1
    32.         set {_lore::*} to split expressions-2 at "||"
    33.         loop {_lore::*}:
    34.             set line (loop-index parsed as a integer) of lore of {_item} to loop-value
    35.         return {_item}
     
  9. KawaiiKitsune

    KawaiiKitsune Member

    Joined:
    Aug 19, 2018
    Messages:
    14
    Likes Received:
    1
    I will try it thanks in advance
    --- Double Post Merged, Aug 20, 2018, Original Post Date: Aug 20, 2018 ---
    I will try it thanks in advance
    --- Double Post Merged, Aug 20, 2018 ---
    it gives me an error on line 28 he does not understand the code
     
Thread Status:
Not open for further replies.

Share This Page

Loading...