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 Damage a value

Discussion in 'Skript' started by Aralwen, Aug 25, 2018.

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

    Aralwen Active Member

    Joined:
    May 26, 2017
    Messages:
    164
    Likes Received:
    14
    Hello, I have a huge problem that blocks me completely. I am looking to put in half damage the life of the player. The thing I do not understand is that with the variable, the code does not work, and without it works ...

    Code doesn't work:

    Code (Skript):
    1. command /dmg:
    2.     trigger:
    3.         set {ActualVote} to player
    4.         set {ActualVote}'s max health to 5
    5.         set {_health} to {ActualVote}'s health / 2
    6.         damage {ActualVote} by {_health} hearts #That doesn't work

    Code work:

    Code (Skript):
    1. command /dmg:
    2.     trigger:
    3.         set {ActualVote} to player
    4.         set {ActualVote}'s max health to 5
    5.         set {_health} to {ActualVote}'s health / 2
    6.         damage player by {_health} hearts #That work ...

    Can you help me? x:
     
  2. Best Answer:
    Post #2 by ShaneBee, Aug 25, 2018
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    try this
    damage "%{ActualVote}%" parsed as player by {_health}
     
    • Agree Agree x 1
  4. Aralwen

    Aralwen Active Member

    Joined:
    May 26, 2017
    Messages:
    164
    Likes Received:
    14
    You're genius ! Thank's :emoji_grinning:
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    You're welcome, glad I could help
     
Thread Status:
Not open for further replies.

Share This Page

Loading...