Solved Chance of

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

Crocie

Member
Jul 2, 2021
36
0
6
16
Please help me, this line dosen't work,

Code:
chance of {key.chance.%player%}%:

Full code

Code:
command /pickset <text> <integer>:
    trigger:
        if arg 1 = "key":
            set {key.random.%player%} to arg 2

on break:
    if event-block is stone:
        if player is holding a diamond pickaxe:
            set {key.chance.%player%} to {key.random.%player%}
            send "%{key.chance.%player%}%"
            chance of {key.chance.%player%}%:
                set {item} to coal
            subtract 1 from {key.chance.%player%}
            chance of {key.chance.%player%}%:
                set {item} to iron ingot
            subtract 1 from {key.chance.%player%}
            chance of {key.chance.%player%}%:
                set {item} to gold
            subtract 1 from {key.chance.%player%}
            chance of {key.chance.%player%}%:
                set {item} to diamond
            subtract 1 from {key.chance.%player%}
            chance of {key.chance.%player%}%:
                set {item} to netherite ingot
            give {item} to player
 
Last edited:
Please help me, this line dosen't work,

Code:
chance of {key.chance.%player%}%:

Full code

Code:
command /pickset <text> <integer>:
    trigger:
        if arg 1 = "key":
            set {key.random.%player%} to arg 2

on break:
    if event-block is stone:
        if player is holding a diamond pickaxe:
            set {key.chance.%player%} to {key.random.%player%}
            send "%{key.chance.%player%}%"
            chance of {key.chance.%player%}%:
                set {item} to coal
            subtract 1 from {key.chance.%player%}
            chance of {key.chance.%player%}%:
                set {item} to iron ingot
            subtract 1 from {key.chance.%player%}
            chance of {key.chance.%player%}%:
                set {item} to gold
            subtract 1 from {key.chance.%player%}
            chance of {key.chance.%player%}%:
                set {item} to diamond
            subtract 1 from {key.chance.%player%}
            chance of {key.chance.%player%}%:
                set {item} to netherite ingot
            give {item} to player
I suggest using {key::chance::%player's uuid%} instead of {key.chance.%player%}, basicly not using dots but colons in general for variables..try that but what error do you get..? Also in this case you wanna use player's uuid not player. You should try to do a research on that and figure out when you should use player's uuid and when player. It's important sometimes.
 
I suggest lightening your code by packaging all the variables into one variable BEFORE you set the chance

Code:
set {Variable} to {key::chance::%player's UUID%}
chance of {Variable}%:
  broadcast "Pink and Purple dinosaurs"
 
I suggest lightening your code by packaging all the variables into one variable BEFORE you set the chance

Code:
set {Variable} to {key::chance::%player's UUID%}
chance of {Variable}%:
  broadcast "Pink and Purple dinosaurs"

'Lightening your code' hilarious. Seems you don't know what you're doing...
 
I suggest lightening your code by packaging all the variables into one variable BEFORE you set the chance

Code:
set {Variable} to {key::chance::%player's UUID%}
chance of {Variable}%:
  broadcast "Pink and Purple dinosaurs"

What the... the heck is this? And even if you would do this... USE A LOCAL VARIABLE
 
Status
Not open for further replies.