Help with making chance drops

I’m trying to make a gimkit map where when you defeated special bosses, there is a chance for a gadget to drop. I wanted to use a knockout manager, but it counts for ALL sentries, not just specifics. Please help!


you can use blocks for rng!
here you can see that i’ve made a random knockout message generator
you can do the same thing i did for the drops-

set ranNum to 1-10

if (ranNum == 10)
{
     give player Green_Seed;
}

i’d recommend you use a trigger for the blocks
if you need to get to the blocks, then what you do is:

the thing you do

put down a trigger and click it
find the ‘Blocks’ button, on the left


and click that

now, a new section should open!
make a new block (When triggered…)
and now you can make your code!

3 Likes

How do I put typed code?

you dont : (
the code is just an example
in block form (typed as text)

[set [ranNum] to | random integer from [0] to [10]]
[if | [ranNum] = 0 
do [broadcast message on channel | channelThatActivatesATriggerOrSmthThatGivesTheItem ]
]

Also, how does this work? How do I do it, I was already using, blocks, but I couldn’t make heads or tails of it.

1 Like

you can think of it as scratch
or as it as a bunch of tasks

basically when i tell gkc

[set [ranNum] to | random integer from [0] to [10]
[if | [ranNum] = 0 
do [broadcast message on channel | channelThatActivatesATriggerOrSmthThatGivesTheItem ]
]

im basically telling it:

heres a property! give it any number from 0 to 10
is the number you picked equal to 10? if it is, then broadcast this channel for me

i’ve been a scratch coder for a pretty decent amount of time so this might not be clear to you
but basically i just think of all that code as tasks and statements for the robot follow
when youre coding blocks yourself, remember that gkc will follow exactly what you tell it to do

okay, ive made the block code, connected it to the sentry and item granter, now what?

test it out and see if it works
keep on defeating the sentry, and eventually, you should get the item you want
if it has high health then you can try making it really easy to knock out for playtesting

Erm, so its giving it too me twice, and its also giving it to me 100% of the time

how often do u want it to give it to you

whenever you beat him, it has a 40% chane to give to you

yeah. you’ll have to have a randomizer that has only two numbers out of five causing the item to be dropped. so in this case basically out of the 10 times in CRC’s system, 4 times it will give a desired gadget. however, this will only work for one sentry…

signing off for tonight so I cant help more until tmr

im currently working on two things now
can i see your block code?
ranNum should be a variable
if its a property then make sure its a number

Trigger


Item granter

main view

i see
the ‘grant player selected item’ always runs because basically
youre telling gkc to do two tasks at one:

  • use rng to send the message or not (rng included)
  • give the player the item (0 rng included)

youre going to want to put ‘grant player selected item’ so that its also put behind the same barrier as the broadcast block
aka ‘if ranNum more than or equal to 4 do [ thing ]’

i dont understand the part about getting the item twice though
maybe check the channels and make sure theres only one giving the item?

Screenshot 2025-05-22 8.10.03 AM
Use this more efficient block code except replace the 10 with 5 and enter this in item granter when recieving broadcast on channel “1r,2r”