Discord Thread some variable stuff

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

This thread came from the skUnity Discord. You can't reply to it here but if you join the skUnity Discord, you'll be able to post a reply there. The thread link is part of the thread's message.
Status
Not open for further replies.

skUnity Discord

Site Manager
Aug 5, 2023
12,749
1
0
The skUnity Discord
discord.gg
1) i have this code
code_language.skript:
 on death of a player:
  attacker is a player                 # only run beneath code if killer is a player
  add 1 to {killstreak::%uuid of attacker%}  # add 1 to kills for killer
  add 20 times {killstreak::%uuid of attacker%} to {xp::%uuid of attacker%} #xp on kill
  set {killstreak::%uuid of victim%} to 0    # reset kills for killed player
  send "&6%{killstreak::%uuid of attacker%}% killstreak! %{l2::%uuid of attacker%}%" to attacker
  play sound "ANVIL_BREAK" at volume 0.4 at pitch 1 to attacker # goofy killsound
  if {killstreak::%uuid of attacker%} is 50: # overdrive preset
    send "Usually you would activate Overdrive here" to attacker # just debugging
  {xp::%uuid of attacker%} is greater than 1000:
    {l2::%uuid of attacker%} is smaller than 1:
      send "&kO&r&e&lPIT LEVEL-UP! &r&3[1] &r&e&l-> &r&3[2]" to attacker
      set {l2::%uuid of attacker%} to 1

but when i load it it says the error from the first picture

Posted by: frissynn from the skUnity Discord. View the thread on skUnity Discord here
 
2) in the code above i want to make the player "lvel up to level 2" upon reaching 1000 xp, but it just does nothing.
i know the issue is somewhere in the line that checks for l2, i have already debugged it (l2 makes the player level up once after reaching 1000xp not on every kill after 1000)
ive tried setting it to 0 with a /clearplayerxp command but it just doesnt do anything, the l2 variable is still <none>
code_language.skript:
command /clearplayerxp:
    trigger:
        wait 20 ticks
        set {xp::%uuid of player%} to 0
        wait 20 ticks
        set {l2::%uuid of player%} to 3

Posted by: frissynn from the skUnity Discord.
 
Status
Not open for further replies.