Help with getting coins on death

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

Strooder

Member
Apr 10, 2021
2
0
1
24
Hello, I'm having trouble making it so you can get coins on death. The people in my server have to die from the void, so I can't really do the simple method and just do normal player death. Here is my not-working code right now:

on damage:
set {lastattacker::%uuid of victim%} to attacker's uuid

on death:
if {lastattacker::%uuid of victim%} is set:
add 5 to balance of {lastattacker::%uuid of victim%} parsed as player
 
Last attacker is an expression, you dont need to make a variable

Code:
on death of player:
  wait 1 tick
  add 5 to balance of last attacker of victim #you can also do 'victim's last attacker'
  send "&6+5 Coins(Kill)"
 
Status
Not open for further replies.