Help with fortune skript

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

FlamingoSaw

Member
Jan 2, 2024
1
0
1
19
on break:
player's gamemode is not creative
set {_fortune} to level of fortune of the player's tool
add 1 to {_fortune}
clear drops
drop {_fortune} of event-block's drops at location of event-block
on break:
if player has fire charge named "&c2x Fortune":
player's gamemode is not creative
set {_fortune} to level of fortune of the player's tool
add 1 to {_fortune}
clear drops
drop {_fortune} of event-block's drops at location of event-block
on break:
if player has fire charge named "&c3x Fortune":
player's gamemode is not creative
set {_fortune} to level of fortune of the player's tool
add 3 to {_fortune}
clear drops
drop {_fortune} of event-block's drops at location of event-block
In this skript i want to do so that if they have a voucher name 2x drops and its active for 2 hours the drops will be doubled..simple i want the 2x chare and 3xcharge to be like a effect and has a timer for it
 
Code:
function Fortune(l:integer) :: integer:
  loop {_l} times:
    add 1 to {_r} if chance of (100/({_l}+2))%
  return {_r}

on break:
  player's gamemode is not creative
  clear drops
  set {_fortune} to level of fortune of tool
  if player has fire charge named "&c3x Fortune":
    set {_fortune} to {_fortune}*3
  else if player has fire charge named "&c2x Fortune":
    set {_fortune} to {_fortune}*2
  drop 1+Fortune({_fortune}) of block's drops at block