How To Make Ores Spawn For Each Player

I’m making an ore spawning system for a mining game. I want the ores to randomly spawn in a specific area which I can do. The problem is I need the ores to be local, so that good players cannot grief bad players. It’s a simple question, I do not need code just an explanation. Thanks

Just spawn them in a local script. Before you say “But what about exploi-”, how else would you do this? Spawning them on the server would just spawn them for everyone, which is not what you want. I suggest that you just fire a remote event to the server when the player mines the local ore so any changes like cash are made on the server. Local changes like GUI can be done on the client :+1:

I would probably do it something like this.

Have a TotalOrePool on the server for every player to keep track on how much every player can mine. This way they can’t just spawn endless on the client.

When a client mines some ore you send this to the server and the server checks if there’s ore left to be mined in the TotalOrePool for that specific player.

Both the server and client can save the timestamp when the ore was mined so both the client and server can start a timer in sync for when the client should spawn new ore and the server should refill the TotalOrePool for the player.

At the beginning of the game the pool for every player should be full so every player would locally spawn all the ore.

1 Like