health Crystal

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

KawaiiKitsune

Member
Aug 19, 2018
14
1
0
25
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_language.skript:
command /hc:
    trigger:
        give player 1 red dye of protection 5 named "&5health crystal"

on right click with red dye:
    heal the player
 
code_language.skript:
on rightclick:
player's tool is red dye named "&5Health Crystal":
heal the player by 5 hearts
damage the player's tool by 5
I think this will work but I'm not sure
You should use an item that can receive damage or something like that.
 
code_language.skript:
on rightclick:
player's tool is red dye named "&5Health Crystal":
heal the player by 5 hearts
damage the player's tool by 5
I think this will work but I'm not sure
You should use an item that can receive damage or something like that.
code_language.skript:
on rightclick:
player's tool is red dye named "&5Health Crystal":
heal the player by 5 hearts
damage the player's tool by 5
I think this will work but I'm not sure
You should use an item that can receive damage or something like that.
it is not possible that I get damage and that another player gets the heal
 
code_language.skript:
on right click on player holding red dye:
    heal the event-entity by 5
    damage event-player by 5
 
code_language.skript:
on right click on player holding red dye:
    heal the event-entity by 5
    damage event-player by 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
 
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
nah i know the feeling... i tend to overthink things at times too
 
Hi i'm bored so I decided to do unnecessary stuff

code_language.skript:
command /hc:
  trigger:
    give player 1 red dye of protection 5 named "&5Health Crystal" # with lore "&dHeal a player by right clicking on them"

# One time use
on right click on player holding red dye:
  if name of player's tool = "&5Health Crystal":
    remove 1 of player's tool from player's tool # Supports item stacking
    heal the event-entity by 5
    damage event-player by 5
    send "&5You have healed &d%event-entity% &5using a &dhealth crystal"
    send "&5You have been healed by &d%player%" to event-entity

# Cooldown:
on right click on player holding red dye:
  if name of player's tool = "&5Health Crystal":
    set {_waited} to difference between {healthCrystal::%player%} and now
    if {_waited} is less than 30 seconds:
      send "&cYou are still on cooldown &7(%difference between 30 seconds and {_waited}%)"
    else:
      heal the event-entity by 5
      damage event-player by 5
      send "&5You have healed &d%event-entity% &5using a &dhealth crystal"
      send "&5You have been healed by &d%player%" to event-entity
      set {healthCrystal::%player%} to now

# If using with lore expression within the command
expression %itemtype% with lore %string%:
    return type: itemtype
    get:
        set {_item} to expression-1
        set {_lore::*} to split expressions-2 at "||"
        loop {_lore::*}:
            set line (loop-index parsed as a integer) of lore of {_item} to loop-value
        return {_item}
 
Hi i'm bored so I decided to do unnecessary stuff

code_language.skript:
command /hc:
  trigger:
    give player 1 red dye of protection 5 named "&5Health Crystal" # with lore "&dHeal a player by right clicking on them"

# One time use
on right click on player holding red dye:
  if name of player's tool = "&5Health Crystal":
    remove 1 of player's tool from player's tool # Supports item stacking
    heal the event-entity by 5
    damage event-player by 5
    send "&5You have healed &d%event-entity% &5using a &dhealth crystal"
    send "&5You have been healed by &d%player%" to event-entity

# Cooldown:
on right click on player holding red dye:
  if name of player's tool = "&5Health Crystal":
    set {_waited} to difference between {healthCrystal::%player%} and now
    if {_waited} is less than 30 seconds:
      send "&cYou are still on cooldown &7(%difference between 30 seconds and {_waited}%)"
    else:
      heal the event-entity by 5
      damage event-player by 5
      send "&5You have healed &d%event-entity% &5using a &dhealth crystal"
      send "&5You have been healed by &d%player%" to event-entity
      set {healthCrystal::%player%} to now

# If using with lore expression within the command
expression %itemtype% with lore %string%:
    return type: itemtype
    get:
        set {_item} to expression-1
        set {_lore::*} to split expressions-2 at "||"
        loop {_lore::*}:
            set line (loop-index parsed as a integer) of lore of {_item} to loop-value
        return {_item}
I will try it thanks in advance
[doublepost=1534797470,1534797437][/doublepost]
code_language.skript:
on right click on player holding red dye:
    heal the event-entity by 5
    damage event-player by 5
I will try it thanks in advance
[doublepost=1534799369][/doublepost]
Hi i'm bored so I decided to do unnecessary stuff

code_language.skript:
command /hc:
  trigger:
    give player 1 red dye of protection 5 named "&5Health Crystal" # with lore "&dHeal a player by right clicking on them"

# One time use
on right click on player holding red dye:
  if name of player's tool = "&5Health Crystal":
    remove 1 of player's tool from player's tool # Supports item stacking
    heal the event-entity by 5
    damage event-player by 5
    send "&5You have healed &d%event-entity% &5using a &dhealth crystal"
    send "&5You have been healed by &d%player%" to event-entity

# Cooldown:
on right click on player holding red dye:
  if name of player's tool = "&5Health Crystal":
    set {_waited} to difference between {healthCrystal::%player%} and now
    if {_waited} is less than 30 seconds:
      send "&cYou are still on cooldown &7(%difference between 30 seconds and {_waited}%)"
    else:
      heal the event-entity by 5
      damage event-player by 5
      send "&5You have healed &d%event-entity% &5using a &dhealth crystal"
      send "&5You have been healed by &d%player%" to event-entity
      set {healthCrystal::%player%} to now

# If using with lore expression within the command
expression %itemtype% with lore %string%:
    return type: itemtype
    get:
        set {_item} to expression-1
        set {_lore::*} to split expressions-2 at "||"
        loop {_lore::*}:
            set line (loop-index parsed as a integer) of lore of {_item} to loop-value
        return {_item}
it gives me an error on line 28 he does not understand the code
 
Status
Not open for further replies.