Can players just be extremely lucky with math.random() if they continuously do good by chance?

So, I’m apart of a few baseball leagues on Roblox, and the way the ball hits the bat is entirely random. (we just play for fun, never cared for skill) Basically, the script makes the velocity of the ball random with math.random() and then your hit is based on whatever comes out (usually the numbers are between like 15, 130).

Anyways, there’s a few players in particular that seem to always do well, and they aren’t exploiting or anything. They’re just entirely hitting well every season we play, but based on chance, shouldn’t they have at least one or two bad seasons, even if they get lucky?

I’ve heard math.random() is more of an algorithm, but is there any reason that some players are continuously lucky and some are continuously unlucky?

2 Likes

sorry I can only think of math.random() only lol

I’m pretty sure it’s just random chance, and they are just extremely lucky.

1 Like

yeah, we can already tell it from what it was called

Maybe you can make a Variable or int value inside of the Player Cald Luck! or do it with leaderstats!

OP was asking if it was completely random, or if it was an algorithm and not completely random.

I’ve heard from a few developers that it’s more of an algorithm, but it still doesn’t explain why some players continuously get lucky to a point where you’d expect them to at least have at least one streak of bad luck, but it doesn’t happen.

Math.random isn’t entirely random, it’s pseudo - random, even if it looks like it’s random, you can change the seed that math.random uses by doing math.randomseed(seed) and then call math.random again; it’ll be based off of the seed.

Something a lot of people do is use math.randomseed(tick()) since it’s constantly updating & never the same number, if you’re concerned about randomness consider updating the seed after each hit, I can’t guarantee this’ll work but it seems to make sense in my head.

1 Like

Don’t call randomseed before every call to random. It’s supposed to be called once at the start of a sequence of random numbers - for example at the start of the game. Or just use the new Random type, it automatically picks a randomized seed so you don’t have to even think about it.

@peterr how “good hits” would you say these lucky players have gotten in a row? If the hits are truly random then there’s nothing preventing long streaks of luck, a longer streak is just less likely.

1 Like
2 Likes

Multiple home runs, long outfield hits, compared to some people that only get ground balls, bunts, etc.