How do "chance of murderer" percentages work?

I’ve been thinking about how specific game mechanics work in Roblox, especially how the murderer is chosen in MM2. We see a percentage of the chance of becoming a murderer before each round.

It increases every time you are not a murderer and resets to 2% after you become the murderer. I want to implement that system into my game, but I don’t know how it’s done properly.

I thought about it and conceptualized two systems through bad drawings on Paint. I don’t know if either one is correct, but I still want to share my thoughts on it.

HDMPWpt1

So, the “spinner” style takes every player and puts them on a “spinner” (not literally), and they take up whatever percentage of the spinner. Then, one person is chosen from there.

HDMPWpt2

The “everyone has their own spinner” style takes the spinner and gives it to every player. Then, their percentage takes up part of the spinner, while the rest is taken up by “not murderer”. (It’s doesn’t mean innocent either, as that is given to everybody after the murderer is chosen)

I also have a few more questions. Where is the percentage stored? Is it a datastore value or just an int value that is created every time a player joins? Is it exploitable? How would I prevent hackers from exploiting that value?

I hope I explained my ideas well and I look forward to what you think and whether you created a system like this before.

3 Likes

I don’t really know about this, but the first thing that comes in my idea is math.random. Maybe you will get a number between 1 - 100 and you check if that random number is 16, 29, 86 or whatever. If your not the murderer, then the increment of becoming the murderer will be like subtracting 2 from the 100 for the players that didn’t got to become murderer. I think using tables or dictionaries are necessary for this.

3 Likes

How would that work? That would allow there to be multiple murderers or no murderers. The first option is much better.

You would probably not store a percentage, but just give each player an entry in a table. If they double their number of entries, do two entries in the table, three for 3x, etc.

You wouldn’t need to save it in a datastore, since it’s probably just base amount (1) * any gamepass multipliers.

Not if you handle everything on the server, which you should already be doing.

Keep it in the server.

4 Likes

Ah I didn’t think that through. My idea was that the system would stop as soon as it finds a murderer, which now that you point it out can go on forever hehe.

Yeah, that would also give whoever’s spinner was spun first a higher chance. Say they have a 50% chance, and so does the next person. The next person would actually have a 25% chance because there’s only a 50% chance of it even getting that far. Definitely better to use one spinner.

3 Likes

There’s been a couple of threads on this. Make sure to do a search before posting. The most recent one I know of was this one 15 days ago in which I responded to:

2 Likes

Sorry about that, I couldn’t find these threads because of the keywords I used.