¿How i can make a mining system?

Hello, i’m trying to make a mining system like Mining inc remastered.

The thing is that i don’t know any tutorials on how to do a mining system like that game

in this topic i’m asking for resources or any tutorials no a entire script

it would be very helpful if you guys know a tutorial like that, i don’t want a model or a opensource just a tutorial or something so i can learn how to make my own.

Thank you

2 Likes

There’s lots of results on Google and here on the forums, try using the search feature :slight_smile: :+1:

this may be useful to you

1 Like

I searched on google but there are not the results that i want

Ty. But that tutorial is not what i want. In the topic i said a mining system like Mining inc remastered. and i did not saw any tutorials on how to make a system like that game. i will give you the link so you can understand: [!New Truck!] ⛏️Mining Inc Remastered ⛏️ - Roblox

Sorry, I thought you meant a Minecraft- like mining system :sweat_smile:

I don’t know about any tutorials on that specifically. Here’s something to get you started though:

Mining.rbxl (35.4 KB)

Here’s the code if you don’t want to open random files off the internet:

--MineToolController LocalScript
local TagS = game:GetService("CollectionService")

local remotes = game.ReplicatedStorage.Remotes
local tool = script.Parent
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

local MINE_TIME = 1.25

function isMineable(i: Instance)
	return TagS:HasTag(i, "Mineable")
end

function findMineableTarget()
	local target = mouse.Target
	if isMineable then
		return target
	end
end

tool.Activated:Connect(function()
	local mineableTarget = findMineableTarget()
	if not mineableTarget then return end
	
	local deactivated = false
	
	local deactivatedC
	deactivatedC = tool.Deactivated:Connect(function()
		deactivated = true
		print("Deactivated")
		deactivatedC:Disconnect()
	end)
	
	task.wait(MINE_TIME)
	if deactivated then return end

	print("Mining")
	deactivatedC:Disconnect()
	remotes.ClientToServer.Mine:FireServer(mineableTarget)
end)
--MiningManager script
local TagS = game:GetService("CollectionService")

local remotes = game.ReplicatedStorage.Remotes

function isMineable(i: Instance)
	return TagS:HasTag(i, "Mineable")
end

function mine(mineable)
	TagS:RemoveTag(mineable, "Mineable")
	
	mineable.Size *= 0.8
	mineable.Anchored = false
end

remotes.ClientToServer.Mine.OnServerEvent:Connect(function(player, mineable)
	if not isMineable(mineable) then return end
	
	mine(mineable)
end)

And here’s how to set it up:

image

2 Likes