How to create a RNG/Spin system?

I have a good amount of experience scripting in roblox, but for the life of me I can’t figure out how to make a rng/spin system like this one

from Slime RNG.

The system is basically a bunch of items showing and being automatically scrolled on screen and which ever the player’s gets is shown in the centre after the effect ends.

I’m not sure how to setup the UI or how to even script it. Any help would be appreciated!

https://create.roblox.com/docs/reference/engine/libraries/math if you scroll and find random you’ll see the full documentation to help
we use math.random
or just literally do ctrl+f and type “random”

heres a working example of a math.random:

local chance = math.random(1, 100) -- we initialise the randomness in the variable yes

if chance <= 20 then
    print("win")
else
    print("lose")
end

some scripters take a more advanced approach such as using a weight system which i enjoy
happy scripting ig

Yes, of course I get that, I’m not talking about how the random chance of getting the item works, but rather how to display it correctly. Like how do I make it so the right item shows in the centre after all the others, moreover in the image there are items above the item the player will obtain too. That’s what I don’t get how to do

thats where ui development comes in

it can get complex at first, but if you want it exactly like that you’d need decals and it seems theres some shine decal behind it, so you’d probably make that part a spinning part of the gui

to connect a server script with the local (client, which is where you’ll handle the guis), you’ll need a RemoteEvent. though your request isn’t quite clear and im not sure what you’re trying to convey, if you’re talking about visually spinning im guessing you’re just putting the chances of an item appearing in that array of item pool

Whenever games do this effect, it’s essentially an illusion. The “rarity” and selection of the items above and below are completely arbitrary most of the time. You can use something like a UI list layout, have the frame populated with a bunch of random items, then you can ensure the amount of time that passes in seconds will always result in it landing on that selected item index in the end.

Alr I think I understand, thanks!