I have been working on a sandbox-like tycoon game, consisting of the usual droppers, buttons, upgraders and collectors. To avoid lag, all tycoon drops are client-sided and only visible to the owner of the tycoon. Just like any other tycoon, the drops should give money to the owner when they touch the collector. However, unlike conventional tycoons, the upgraders in my game can be changed by the owner of the tycoon. The issue is that I cannot find a way to make the collection process of the drops exploit proof.
The value of the drops is parented to the drop itself on the client, so that the upgraders don’t have to fire a remote event to the server to add to the value of every drop that touches the upgrader. I’m aware exploiters would be able to change this value, which is why I would need a server-side check.
My solution was to create a running total of the value of all drops that are on the client and add to it based on the upgraders that the owner has placed. Collecting drops would subtract the value of the drop from the total. If this total went below 0, I would know that the owner is changing the values of these drops. This solution would work fine if my tycoon didn’t allow the owner to change which upgraders are on the conveyor. Between the time the drop is spawned and its value is calculated and added to the total, the owner could change out an upgrader, making the total drop value incorrect.
Any ideas on how to achieve a server-side check for the value of these drops without flooding the server with remote events? Or is there a better way to solve my overall issue of which I am unaware? Please feel free to ask for any further information needed.
Edit: One game that does this is Miners Haven, which includes server-sided upgraders, but client-sided drops to reduce lag.
1 Like
what you can do is to make every dropper store the amount of money on the serverside as a simple value somewhere in the serverstorage so the player can’t manipulate it. Then when the client-sided part touches the collecter it will do some sort of :FireServer
in a LocalScript (I’m pretty sure) to tell the server to add the server-sided stored value into the players wallet. The only exploit that could be done here is players getting the money earlier, but that shouldn’t be such a big deal.
I hope this works!
1 Like
Thank you for your reply! This would work for a conventional tycoon, but how would I account for the upgraders that increase the value of drops as they pass through? The only thing I could think of is firing a lot more remote events to the server, but that would cause far too much lag.
Are you planning for the owner to have multiple tracks or just one?
If you can only have one track you can have a script check which and how many upgraders there are. Then in the value script of the dropper that will be calculated into the value before being stored in the serverstorage.
1 Like
I am only planning for one track, but the upgraders can be swapped out and changed by the owner. So between the time the drop value is calculated and the drop touches the upgrader, that upgrader could be swapped out for another with a different upgrade amount. Thank you for your continued help though!
The only thing I can think of is to make the collecter a fully visual thing meaning that the droppers will immediately give the money to the player when a wait() timer has expired. The only other thing I can think of is making nothing serversided. No tycoons have really had lag issues due to a lot of parts being dropped. Unless you got like 20 tycoons or dropper that drops 50 parts a second lag shouldn’t be that bad.
1 Like
Yeah making all the drops server sided and setting network ownership of the drops to the owner will be my backup plan if nothing comes of this post. Thank you!