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

GelloJoe

Member
Jul 4, 2024
2
0
1
20
Hi does anyone have a skript on when the player dies, they lose money but the attacker doesn't get any of that money? I'm trying to make it so that gamerule keepinventory is true but in exchange for death is 20% of their balance.
 
AppleScript:
on death of a player:
    set {_bal} to victim's balance * 0.2
    remove {_bal} from the victim's balance
    if attacker is a player:
        send "&7You've lost %{_bal}% from %attacker's name%"
        stop
    send "&7You've lost %{_bal}%"
 
AppleScript:
on death of a player:
    set {_bal} to victim's balance * 0.2
    remove {_bal} from the victim's balance
    if attacker is a player:
        send "&7You've lost %{_bal}% from %attacker's name%"
        stop
    send "&7You've lost %{_bal}%"
Thank you for the response, however I encountered some errors

[15:55:09 INFO]: [Skript] Reloading all scripts...
[15:55:09 INFO]: Line 3: (deathmoney.sk)
[15:55:09 INFO]: Can't understand this expression: 'victim's balance * 0.2'
[15:55:09 INFO]: Line: set {_bal} to victim's balance * 0.2
[15:55:09 INFO]:
[15:55:09 INFO]: Line 9: (deathmoney.sk)
[15:55:09 INFO]: Use 'attacker' and/or 'victim' in damage/death events
[15:55:09 INFO]: Line: send "&7You've lost %{_bal}% from %attacker's name%"
[15:55:09 INFO]:
[15:55:09 INFO]: Line 13: (deathmoney.sk)
[15:55:09 INFO]: Use 'attacker' and/or 'victim' in damage/death events
[15:55:09 INFO]: Line: send "&7You've lost %{_bal}%"
[15:55:09 INFO]:
[15:55:09 INFO]: [Skript] Encountered 3 errors while reloading all scripts! (19ms)

Sorry I'm very new to script
 
in line 3 try to replacing 'victim's balance' with some variable of the balance

in line 9 just add 'to victim' to the end

and do the same in line 13


im not the best at skript either but i think this should fix a few errors
 
  • Like
Reactions: GelloJoe