You know like spin wheels, or ink game minigames, or like the dbd minigame, etc. Do they work based on the ui or just the code? Like for example, for the spin wheel do they know what reward u get based on what the pointer is on, or is it just behind the scene code and then they spin the wheel to land on a predetermined reward? For the dbd minigame, if u click does it check if ur pointer is on the red highlight bit, or is it just code that knows if ur click is right or not?
To securely implement a UI based minigame like a spinning prize wheel, you would invoke the server which would instantly return a final result. The result would then be “played” on the wheel by the client.
2 Likes
Let’s say there’s a wheel with 4 possible rewards, each taking up 90 degrees of the circle. I would get a random number from 0 to 360, use the modulus thing (random % 90) to find which section of the wheel it lands on, and then tween the rotation of the wheel for the visuals. And like @East98 said, you should pick the number on the server for security.
EDIT: actually don’t do modulus, I meant floor divide (//)
Both. They are just (mini) programs made with GUI elements.
The spin is a rotate property, in this case.