Someone plz fix my script

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

IsaacGamerMC

New Member
Aug 31, 2020
6
0
1
I am trying to make a sword that have a 1/20 chance to give the player 5 gold nuggets upon hitting an enemy.
 

Attachments

  • Screenshot 2020-08-31 at 1.09.08 PM.png
    Screenshot 2020-08-31 at 1.09.08 PM.png
    315.6 KB · Views: 299
Try this:
code_language.skript:
variables:
    {midas_give_gold::%player%} = 0
on damage:
    attacker's tool is a diamond sword
    name of attacker's tool is "Midas' Sword"
    set {midas_give_gold::%attacker%} to random integer from 1 to 20
    if "%{midas_give_gold::%attacker%}%" is "2":
        send "Your Midas' Sword granted you 5 gold nuggets" to attacker
        give attacker 5 golden nugget
 
Last edited: