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!

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

Resetting variables?

Discussion in 'Requests' started by Warpedtimes, Feb 12, 2021.

  1. Warpedtimes

    Warpedtimes New Member

    Joined:
    Feb 12, 2021
    Messages:
    4
    Likes Received:
    0
    So I wanted players to reciver souls when they kill someone. I implemented this to give them the soul (uses essentials to make the item) and it works but when they jumped into the void or were hit the players wouldn't receive a soul. So I used the loop someone else made but now if someone jumps or falls into the void without being hit again they will still die to the damager and the damager will still get the soul. Is there anyway to reset who the damager and victim are to not do this?

    Code (Text):
    1. on death:
    2.     if damage cause is not void:
    3.         victim is a player
    4.         damager is a player
    5.         execute console command "give %damager% ghast_tear 1 name:&4Soul lore:&cA_human_soul"
    6.         send "&aYou killed &4%victim%" to damager
    7.         send "&e&l<&c&l!&e&l>&b You have gained a Soul" to damager
    8.         send "&aYou were killed by &4%damager%" to victim
    9.  
    10. every 1 second:
    11.     loop all players:
    12.         if loop-player's y coordinate is below 1:
    13.             set loop-player's health to -1
     
  2. Jakkeren

    Supporter

    Joined:
    Mar 23, 2017
    Messages:
    63
    Likes Received:
    3
    Code (Text):
    1. every 1 second:
    2.     loop all players:
    3.         if loop-player's y coordinate is below 1:
    4.             set loop-player's health to -1
    Nonononoonno .... nononononoono... ^this line is why everyone remotely skilled in java things skript is garbage. This will kill your servers TPS in no time.

    I really don't understand what you are trying to do. Should people get souls when dying from the void or not?

    Code (Text):
    1. execute console command "give %damager% ghast_tear 1 name:&4Soul lore:&cA_human_soul"
    ^here I'd also just use the vanilla skript give function:

    Code (Text):
    1. give 1 of ghast tear named "&4Soul" with lore "&cA human soul" and "newlineinlore" and "newline2"
    Please elaborate, since I'm certain your issue is easily fixed, but is hard to understand from you description :emoji_slight_smile:
     
  3. Warpedtimes

    Warpedtimes New Member

    Joined:
    Feb 12, 2021
    Messages:
    4
    Likes Received:
    0
    Thanks for replying. What I want is for players to get give when they are hit into the void by another player. The loop was for instantly killing players who fell into the void so they wouldnt take ages to die. Im running a sky mining server so its common to be hit into the void or fall. With the loop implemented players would receive souls from killing someone but they would still continue to receive the souls and kill credit whenever someone jumped into the void again.

    Basically I just wanted players to instantly die when falling into the void and to have a system where players receive souls on kill.
     

Share This Page

Loading...