✓ Accepted answer
This request with all will be a lot, I will only help you get started, this should be handled in the LocalScript aiding the use of the ‘Pickaxe’, for this to work we’re going to use mouse.Target, This returns whatever object the cursor is beneath.
I will be Scripting by the default structure of a Tool: Tool - Handle - LocalScript, remember that when Scripting a Tool, primarily just creating one, a BasePart of the name, with a capital H, “Handle”.
local tool = script:FindFirstAncestor(“Pickaxe”)
local handle = tool:WaitForChild(“Handle”)
local equipped = false
local player = game:GetService(“Players”).LocalPlayer
local cursor = player:GetMouse()
local cursorPos = cursor.Target
local oreGui = player:FindFirstChild(‘PlayerGui”).oreGui
tool.Equipped:Connect(function()
if not equipped then return end
equipped = true
if (oreGui) then
spawn(function()
while equipped wait(.5) do
cursorPos = Cursor.Target
end
end); wait()
while equipped wait(.5) do
pcall(function()
local cursorObject = cursorPos
if (cursorObject:IsA(“BasePart”) and cursorObject.Name == “Ore”) then
oreGui.Text = cursorObject.Name
end
end
end
end
end)
This should get you started, creating this kind of cursorCheck, one I’m familiar with, is quite hard, but this will get you up on your feet, it has flaws but is functional, it’s up to you to finish it, I’m not going to write something that long, you understand, I hope this helps you out anyway, if so, don’t forget to accept this answer and upvote! Good luck
1 comment
In what part of your code are you struggling? Post it alongside your question please