Imagine a crate spin -
a normal crate spin is predetermined on the server using RNG and will show an animation on the client rolling through a bunch of items ranging from common to legendary and if you're lucky you will get something good.
Now imagine a crate game -
this crate spin will allow you to press 'STOP' when you see an item you like (if you're fast enough)
the problem with the crate game (or any GUI games) is securing it from exploits. As i still have to run the tweens on the client i also have to send the information back to the server the exact position i pressed 'stop' without just firing the winning item via an unsecured remote
so far i have this
--player buys crate
the server randomly selects 50 items to put into a roll frame
--player clicks start
i run the tween on the client
at the exact same time the server runs a counter for every item that passes
--player clicks stop
the client tween pauses
the server counter stops
--the server rewards player with the item the tween is paused on
the server does this by getchildren() of all items in roll frame
and selects the item using the index set to the counter (+1 or 2 due to UiListLayout etc)
how do i ensure that the counter is always align with the tween on the client due to lag or slight positioning issues such as the rollframe cursor stopping in the middle between 2 different items? OR another way to do this altogether?
** You are now Level 10! **