Randomize a Gadget on Knockout

hey

I was finishing up touches with my game, and I added a randomizer for your gadgets instead of manually choosing which one you want.

The randomizer works, but doesn’t when a player gets knocked out.

I tried a lifecycle with channels, the lifecycle was on “Player Knocked Out”, with a channel that sends to the trigger and all of that.

The block code randomizes a gadget and gives it to you when triggered, and it has 7 gadgets.

I searched “randomizer on knockout” and nothing helpful appeared for me
3 Likes

use a life cycle that’ll trigger your rng

Or make the players respawn in an area that’ll trigger a zone to start the rng and teleport them to the actual map.

sure :+1:

1 Like

1: lifecycle was tried with channels and wires
2: like a loading screen with “randomizing your gadget”?

2 Likes

Could I see your block code? And are you removing their previous gadget before granting them a new one? And how many item slots do they have?

2 Likes

School computer is dead.
Yes, I made that a feature in the settings.
1 or 2 I believe.
AA I ACCIDENTALLY MARKED SOLUTION XD

Wait.
I am on a different device rn, lemme see if I can run gimkit

1 Like

Well I’m assuming this system works when the game begins, so most likely it’s not a problem with your code anyway, it’s most likely a problem with the lifecycle since it couldn’t be their connection if you tried with channels and wires. It could be with the granting process due to you already having a gadget, so you might want to try removing the gadget before assigning them a new one.
Also, if you have any properties, make sure they’re player scoped (the ones related to this system, at least).

2 Likes

I read 0.2 of this post

On knockout it is supposed to delete the gadget they had, I made that a feature in the game settings for the ffa.

no properties

2 Likes

Deleting the gadget they have on knockout? All you have to do is either

  1. Do the NON sophisticated way, and add 7 item granters that grant -5 of every gadget on knockout (using chanels & stuff you can figure it out I have confidence)
  2. Do the sophisticated way, and add checkers. If they have a blaster, delete it.
    It looks like the non spohisticated way is actually more memory efficient, but could be a bit laggier since you’re taking away 35 things at once…

If you want them to get an item on knockout, just put your good ol’ RNG


and have corresponding item granters.

sure I will do the non sophisticated way with 89 percent memory

I have no confidence

hmm very smart
maybe

I have corresponding item granters that activate when the trigger is triggered, and gives a random gadget.
The triggered is triggered on game start and on player knockout, so I put a “,”

I guess
moi sleep deprived self has 0.1 of confidence right now

U want me to break it down for u? More details and stuff?

Well

Have the lifecycle track when player is knocked out. Have it transmit on RemoveWeapon. Then, add your item granters. All should grant -5 (or whatever) of the gadget. You said you had 7 different gadgets, and I didn’t know which ones you had, so I’m doing it with all 13 gadgets (lmao).


oh I didn’t know you can grant negative amounts

I’ll try this tomorrow and give you an update around 9-10pm est.

hth, I used a block code like that.
an else if chain for every gadget.
if the rng lands on..
let’s say pml
it would broadcast on channel PML and give you the gadget via item granter.

1 Like

Ummm so that code doesn’t work. You’re generating a new random integer every else/if condition, so that will break very often.
Instead, use 1 number and concat!

Broadcast Message On Channel { Create Text With | "Weapon"
                                                | random integer from [1] to [7]

Don’t worry haha not something pretty much anybody is good at. And I’ll be making a block code guide series so people can become good at block code because there’s not really any general guides about “how to block code” or even teaching the basics.

2 Likes

Ahh thanks HTH (block code is NOT a strong suit of mine lmao I “learned” the basics less than a month ago)

PLS PLS PLS DO SO I’M NOT MISINFORMED AND GIVE PEOPLE BAD ADVICE I NEED THIS OML :laughing: :rofl:

3 Likes

still need help

Use this set up with 7 item granters, one for each gadget you’re using. For example, you get a common zapper for the item granter that receives “Weapon1”.

2 Likes

you might be able to make a randomizer by using blocks and using the random integer from _ to _