I want to know how I can secure my case unboxing system.
The system works by using RemoteEvents to notify the server of what item has been unboxed. As you can see, this is easily exploitable.
Thanks in advance!
I want to know how I can secure my case unboxing system.
The system works by using RemoteEvents to notify the server of what item has been unboxed. As you can see, this is easily exploitable.
Thanks in advance!
You should never be handling things like this on the client. As you said, it’s easily exploitable. A better way of doing this would be to fire a remote function from the client to the server, requesting a case to be opened.
The server can then perform various checks here relevant to your game, such as checking if the player has enough currency to open the case. Assuming the player passes the checks, you can choose a random item (on the server) and return that value to the client.
The reason I am handling this on the client is because the case unboxing system has a scroller, like the one in mm2.
Instead of using remote events to signal the server of the item. Use a remote function to signal the server that the player wants to open a case. The server gets the item and returns it to the player. You can just fire the function when they click a button.
I’m a bit confused as to what you mean by scroller, but I am sure that it should not have an effect over who is handling the actual fetching of the item.
So the scroller is like this:

The system just accelerates and decelerates the box movement (in the scroller).
Then, when the scroller comes to a stop, it finds the closest box to the line and gives that item.
You can do all of this client side. After the server informs the client of what item they’ve received, you can play this animation and force it to land on the selected item.
When they decide to unbox something, instantly decide what the item they will get (on the server). Then just use a RemoteEvent for effects on the client. You’ll also have to do other checks like if they unlock/own a crate, etc.
Oh, okay! Thank you both for this information! 