Ask coding questions

← Back to all posts
Among Us Master Edition
h
Gavin429

I didnt know how to code the imposter part cause like the imposter will basically be op if I don't know how to code to let them randomly get caught or something (indeed i don't). and also didn't code the vote kick part and the last 2 crewmate tasks. IJUST DONT KNOW HOW TO CODE ALL THESE STUFFA ND LET THEM WORK AT THE SAME TIME. someone help?

Voters
Gavin429
Comments
hotnewtop
HayIsForHorses

Well, I think you do actually know how to make them randomly get caught, you just don't know it. What you can do is, you can use your dice again (random.randint(1, 3)) and if it is one there will be people in there, but let's say if it's three there will be two people in there (learn how to use random weights to have a lesser chance for 2 people), and about the votekick, if the player is a crewmate, randomly choose a color to be the impostor, and if the player votekicks the imposter, they win.
And for uploading and downloading, for a simple code you can use:

You could also use a random function to determine the location of download.
Sorry for all this text, good luck on the game!

You can try to use this link for learning about weights:
https://www.geeksforgeeks.org/how-to-get-weighted-random-choice-in-python/

Gavin429

@HayIsForHorses thx for the reply, and yes I did think about what you said, but I just don't know how to assign a cremate or an imposter to a random color. like for example I don't want green to die while green is the color of the user and his game keeps going - like I just dont know how to erase an element from the list.

Gavin429

@HayIsForHorses the vk part is kind of hard to code too... assigning colors to every people and roll and dice to see who got voted out

HayIsForHorses

@Gavin429 I see what you mean about the random imposter color, and I think I have a solution.
For the crewmate and impostor, I'll assign a variable for easier reading:

Okay, so what this does is randomizes your colors list and (if want more random), chooses a random color from the list and marks it as crewmate_color or imposter_color, (choose as needed), and then removes that color chosen from the list, so that you cant use it anymore, only for the crewmate or impostor itself.
:D

Gavin429

@HayIsForHorses thank a lot. appreciated

HayIsForHorses

@Gavin429 No problem! I always love helping, heck, I could collab with you.

Gavin429

@HayIsForHorses sure... i cant find u typing ur username on the invite thingy, I don't want to put the share link here for everyone either... u have a discord or something I can send it to you?

HayIsForHorses

@Gavin429 Oh, try this:
my display name is paradigmz
jusr so u know i wont be online much due to school and band
BTW: I think we are in 2 different timezones. You keep replying when I'm asleep, haha.

Gavin429

@HayIsForHorses what timezone are u? guess ur asleep right now but I also tried paradigms and hayisforhoses. both didn't work. I'm not sure why maybe u turned on some private mode or something idk.

HayIsForHorses

@Gavin429 I am in CST.
I'll send you an invite to a team i'm in.
Here's the link: https://www.youtube.com/watch?v=-85fxpbSBuI

Gavin429

@HayIsForHorses r u sure this is the link...

Gavin429

@HayIsForHorses btw im in cst too maybe u just sleep early

HayIsForHorses

@Gavin429 I'm sorry about the link.
But I checked the team, and you joined!
Now, I am going to fork your repl and put it into our group, so make sure to edit it from there.

MrVoo

If someone is nearby when you kill someone, it could trigger a meeting a random amount of time later, and that person plus one or two could vote you?

Gavin429

@MrVoo bruh i seriously dont know... wdym nearby? you saying I should also do room names like electrical and security? hard to code tho

MrVoo

@Gavin429 If you keep thinking you can't you never will, just get started and see what happens.

Gavin429

@MrVoo sure buddy