Solved How would I go about fixing this so it works as intended?

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

    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!

Oct 9, 2023
2
0
1
I've tried everything I could think of but nothing has worked, how can I make it so this runs as intended?
I'm making a little bliss skript for me and my friends to play around with but I can't get this to work
It's supposed to lower the gem from one level to the next (so like pristine 5 to pristine 4, pristine to scratched, ruined to broken, etc)
I don't know what's wrong with it exactly, I'm pretty sure it's just not saving the player to the variable but I don't know.
I don't get any errors when I try to use it, it just doesn't give me the gem when I respawn (I've been testing using pristine +5, when I die and then respawn I don't get a pristine +4 gem, I don't get anything at all)
If someone could tell me how I can make it work, please do, that would be appreciated.
Code:
on death of a player:
    if victim's inventory contains amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bPristine +5", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds.", "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." and "<##CF9FFF>Ghostly &7- 15 percent of attacks will go right through you" with all flags hidden:
        add victim to {ag1::*}
    if victim's inventory contains amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bPristine +4", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds.", "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." and "<##CF9FFF>Ghostly &7- 15 percent of attacks will go right through you" with all flags hidden:
        add victim to {ag2::*}
    if victim's inventory contains amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bPristine +3", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds.", "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." and "<##CF9FFF>Ghostly &7- 15 percent of attacks will go right through you" with all flags hidden:
        add victim to {ag3::*}
    if victim's inventory contains amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bPristine +2", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds.", "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." and "<##CF9FFF>Ghostly &7- 15 percent of attacks will go right through you" with all flags hidden:
        add victim to {ag4::*}
    if victim's inventory contains amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bPristine +1", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds.", "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." and "<##CF9FFF>Ghostly &7- 15 percent of attacks will go right through you" with all flags hidden:
        add victim to {ag5::*}
    if victim's inventory contains amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bPristine", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds.", "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." and "<##CF9FFF>Ghostly &7- 15 percent of attacks will go right through you" with all flags hidden:
        add victim to {ag6::*}
    if victim's inventory contains amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bCracked", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds." and "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." with all flags hidden
        add victim to {ag7::*}
    if victim's inventory contains amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bCracked", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds." and "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." with all flags hidden
        add victim to {ag8::*}
    if victim's inventory contains amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bDamaged", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds." and "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." with all flags hidden
        add victim to {ag9::*}
    if victim's inventory contains amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bRuined", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds." and "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." with all flags hidden
        add victim to {ag10::*}
    if victim's inventory contains amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bBroken", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds." and "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." with all flags hidden
        add victim to {ag11::*}
    if victim's inventory contains amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bShattered", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds." and "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." with all flags hidden
        add victim to {ag12::*}
    

on respawn:
    if {ag1::*} contains player:
        give player 1 of amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bPristine +4", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds.", "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." and "<##CF9FFF>Ghostly &7- 15 percent of attacks will go right through you" with all flags hidden
    if {ag2::*} contains player:
        give player 1 of amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bPristine +3", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds.", "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." and "<##CF9FFF>Ghostly &7- 15 percent of attacks will go right through you" with all flags hidden
    if {ag3::*} contains player:
        give player 1 of amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bPristine +2", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds.", "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." and "<##CF9FFF>Ghostly &7- 15 percent of attacks will go right through you" with all flags hidden
    if {ag4::*} contains player:
        give player 1 of amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bPristine +1", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds.", "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." and "<##CF9FFF>Ghostly &7- 15 percent of attacks will go right through you" with all flags hidden
    if {ag5::*} contains player:
        give player 1 of amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bPristine", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds.", "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." and "<##CF9FFF>Ghostly &7- 15 percent of attacks will go right through you" with all flags hidden
    if {ag6::*} contains player:
        give player 1 of amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bScratched", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds." and "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." with all flags hidden
    if {ag7::*} contains player:
        give player 1 of amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bCracked", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds." and "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." with all flags hidden
    if {ag8::*} contains player:
        give player 1 of amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bDamaged", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds." and "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." with all flags hidden
    if {ag9::*} contains player:
        give player 1 of amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bRuined", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds." and "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." with all flags hidden
    if {ag10::*} contains player:
        give player 1 of amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bShattered", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds." and "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." with all flags hidden
    if {ag11::*} contains player:
        give player 1 of amethyst shard of curse of vanishing 1 named "&5&lAstra &7Gem" with lore "&bShattered&k", "<##BF40BF>Powers:", "<##CF9FFF>Daggers &7- Shoot 5 daggers, if a player is hit with one they take 3 hearts of damage and their gem is disabled for 10 seconds.", "<##CF9FFF>Spook &7- Punch a player when holding the Astra Gem to spook them, spooking them disables their gem for 10 seconds." and "<##CF9FFF>Astral Projection &7- puts the player in spectator mode for 3 seconds, they are returned to their original position afterwards." with all flags hidden
 
- store every gem in a list variable starting from 0
Code:
set {gem::0} to ... Pristine +5
- whenever they respawn, give them the next one
Code:
on respawn:
  add 1 to {deaths::%player's uuid%}   # you can use statistic expression from skbee if you are feeling fancy
  give player {gem::%{deaths::%player's uuid%}%}
- {deaths::%player's uuid%} will give you what gem they are using right now