#Heyo! I need some help changing a function for a period of time when a command is executed

1 messages · Page 1 of 1 (latest)

last bison
#

Add a parameter to replace "1"

pure trench
#

like an arg?

#

sorry im pretty new

last bison
#

So it would be "drop {_int} of..."

pure trench
#

kk

#

then i just set {_int} 1 with a command?

last bison
#

No I mean

#

When you create your functio

#

Function*

#

You set some parameters after it, so it would be int: integer

#

Call it whatever you want

pure trench
last bison
#

don't set it with a command

#

function gensDrops(L: location, I: itemtype, int: integer):

#

oh wait

pure trench
#

gensDrops(loop-value-2, coal) if block at loop-value-2 contains coal block

#

i have that

last bison
#

make a command to set {boost} to arg-1

#

then you can do drop (1 * {boost}) of {_I} at block above {_L} without velocity

#

forget what I said before

pure trench
#

ohh oke

last bison
#

default boost needs to be 1

#

or it wont spawn

#

drop*

pure trench
#

prolly me just being dum

last bison
#

in your function

pure trench
#

ohhhh

last bison
#

send the command you did to make the boost

pure trench
last bison
#

change text to integer

pure trench
last bison
#

set boost to 1

#

so it's 1*1 = 1

pure trench
#

then it spawns 3?

last bison
#

eh

#

when you set it to 1?

#

wait

#

I'm so dumb

#

you can just do "drop {boost} of ..."

#

@pure trench

pure trench
last bison
#

eh

#

send the new code you have

pure trench
#

function gensDrops(L: location, I: itemtype):
drop {boost} of {_I} at block above {_L} without velocity

command /genboost [<integer>]:
permission: gen.boost
trigger:
set {boost} to arg-1

#

yea it multiplys 3 buy whatever the boost is

last bison
#

try to add delete {boost} before setting it

pure trench
last bison
#

show me where you use the function

pure trench
#
every 2.5 seconds:
    loop all players:
        loop {gens::location::*}:
            gensDrops10(loop-value-2, dirt) if block at loop-value-2 contains dirt
            gensDrops(loop-value-2, stone) if block at loop-value-2 contains deepslate
            gensDrops(loop-value-2, coal) if block at loop-value-2 contains coal block
            gensDrops(loop-value-2, amethyst cluster) if block at loop-value-2 contains budding amethyst
            gensDrops(loop-value-2, iron ingot) if block at loop-value-2 contains iron block
            gensDrops(loop-value-2, emerald) if block at loop-value-2 contains emerald block
            gensDrops(loop-value-2, diamond) if block at loop-value-2 contains diamond block
            gensDrops(loop-value-2, gold ingot) if block at loop-value-2 contains gold block
            gensDrops(loop-value-2, redstone dust) if block at loop-value-2 contains redstone block
            gensDrops(loop-value-2, pink petals) if block at loop-value-2 contains stripped cherry wood
            gensDrops(loop-value-2, lapis) if block at loop-value-2 contains lapis block
            gensDrops(loop-value-2, obsidian) if block at loop-value-2 contains crying obsidian
            gensDrops(loop-value-2, bone meal) if block at loop-value-2 contains bone block
            gensDrops(loop-value-2, magma cream) if block at loop-value-2 contains magma block
            gensDrops(loop-value-2, ice) if block at loop-value-2 contains blue ice
            gensDrops(loop-value-2, wither rose) if block at loop-value-2 contains soul soil
            gensDrops(loop-value-2, sculk) if block at loop-value-2 contains sculk catalyst

function gensDrops(L: location, I: itemtype):
    drop {boost} of {_I} at block above {_L} without velocity
function gensDrops10(L: location, I: itemtype):
    drop 10 of {_I} at block above {_L} without velocity


command /genboost [<integer>]:
    permission: gen.boost
    trigger:
        delete {boost}
        set {boost} to arg-1
last bison
#

weird

#

let me try something

#

try this

#
every 2.5 seconds:
  loop all players:
    loop {gens::location::*}:
      gensDrops10(loop-value-2, dirt, {boost}) if block at loop-value-2 contains dirt

function gensDrops(L: location, I: itemtype, drop: int):
  drop {_drop} of {_I} at block above {_L} without velocity```
last bison
#

lol it's weird