Solved Randomizing drop between 4-16

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

PanHack

Active Member
Dec 18, 2019
143
8
18
24
Ok so i want to RANDOMIZE drop between 4-16
PLUGINS :
SKQuerry
Wildskript
RandomSK
Skellett
skRayFall
Code:
on mine of dirt:
    if player's tool is shovel:
        chance of 100%:
            set %random integer from 4 to 16% to a random integer between 4 and 16
            drop %random integer from 4 to 16% dirt
            broadcast "&a&l%player% &c&lhas got %random integer from 4 to 16% iron"
it works a little bit it randomizes number on chat but it doesn't drop that what was randomized
 
Ok so i want to RANDOMIZE drop between 4-16
PLUGINS :
SKQuerry
Wildskript
RandomSK
Skellett
skRayFall
Code:
on mine of dirt:
    if player's tool is shovel:
        chance of 100%:
            set %random integer from 4 to 16% to a random integer between 4 and 16
            drop %random integer from 4 to 16% dirt
            broadcast "&a&l%player% &c&lhas got %random integer from 4 to 16% iron"
it works a little bit it randomizes number on chat but it doesn't drop that what was randomized
Working on the skript, just encountered an issue in "drop {random} dirt", the skript wont take the variable as an integer, parsing it doesnt seem to work. Got any ideas, Malia?
[doublepost=1578785047,1578784350][/doublepost]Found a work-around, here ya go
Code:
on mine of dirt:
    if player's tool is shovel:
        chance of 100%:
            set {random} to a random integer between 4 and 16
            loop {random} times:
                drop 1 dirt
            broadcast "&a&l%player% &c&lhas got %{random}% iron"
 
  • Like
Reactions: PanHack
Working on the skript, just encountered an issue in "drop {random} dirt", the skript wont take the variable as an integer, parsing it doesnt seem to work. Got any ideas, Malia?
[doublepost=1578785047,1578784350][/doublepost]Found a work-around, here ya go
Code:
on mine of dirt:
    if player's tool is shovel:
        chance of 100%:
            set {random} to a random integer between 4 and 16
            loop {random} times:
                drop 1 dirt
            broadcast "&a&l%player% &c&lhas got %{random}% iron"
EDIT: using ITEM ID (265) will fix problem
 
How come it won't even parse? Have you tried to parse it as number?
Yes, I have tried parsing it both as a number and integer. So either it won't parse or I am not using it correctly.
 
Status
Not open for further replies.