How can I create a mining game?
So, I’m trying to recreate a summer memory which didnt really go to plan, since I couldn’t generate ores because of my current knowledge of generation of terrain. I want to make a game like epic mines and the quarry but more fun. I want random blocks to spawn at certain layers which can easily be done with an if statement checking if the Y axis is <400. This game was very fun to make back in 2019, but I don’t have the knowledge to progress, so here I am asking kindly for help asap. I got a list of what I need.
– List – Ore Generation, sets up a basic mine. Ore or basic blocks to spawn in the direction it was destroyed. If you destroy the bottom, It will go, front, back, left and bottom. This depends on the side it was destroyed.
Sorry if I sound greedy or desperate for a script to do this - It’s my knowledge of doing this. I just want to remake a memory I had from summer 2019. Just when the summer truly began. I never updated after a few weeks since I couldn’t update, because of my lua scripting knowledge. Please understand, be a nice person and help me out if you may. This would make my game nearly complete, as I can make the ores and build the rest. Again, understand what I’ve said: “Be a nice person, help me out if you may.” Wish you all have a great day folks.
I would try making the ore model in a separate place, like the ServerStorage
. You can then clone it and set the parent to the workspace, where you can then set the actual position as three random values that are limited to the minimum and maximum of the area.
Let's say, for example, you've got a 10x10x10 cube that you want ores to generate in. I would try this.
local xMin = 1 local xMax = 10 local yMin = 1 local yMax = 10 local zMin = 1 local zMax = 10 local xCoord = math.random(xMin,xMax) local yCoord = math.random(yMin,YMax) local zCoord = math.random(zMin,zMax) local waitTime = 20 --The amount of time to wait between spawns for wait(waitTIme) do local ServerStorage = game:GetService("ServerStorage") local ore = ServerStorage.Ore:Clone() ore.Parent = workspace --The ore is now in the workspace, time to set its position. ore.Position = Vector3.new(xCoord,yCoord,zCoord) --The ore is now in a random position within your 10x10x10 cube. end