Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Pickaxe script wont mine any ore that I click on. This is a local script Help?[SOLVED]

Asked by 8 years ago
Edited 8 years ago
--Variables
local Player = game.Players.LocalPlayer
local mouse = Player:GetMouse()

--Mining
mouse.Button1Down(function()
    if mouse.Target == nil then return end
    if mouse.Target == 'Rock'  then
        mouse.Target.Ore:remove()
    end
end)

mouse.Button1Down:connect()

It will not remove the ore once i click.

0
Output error:21:17:43.283 - Players.Player1.Backpack.PickAxe.PickAxeScript:6: attempt to call field 'Button1Down' (a userdata value) SmxkePurpp 50 — 8y
0
At line 06 put mouse.Button1Down:connect(function() Simnico99 206 — 8y
0
It still will not work. SmxkePurpp 50 — 8y
0
What is the output? Simnico99 206 — 8y
View all comments (4 more)
0
:Remove is deprecated also use :Destroy() instead Simnico99 206 — 8y
0
:Destroy still does not destroy the ore. It also doesn't show any errors in the output. SmxkePurpp 50 — 8y
0
Remove line 7 Simnico99 206 — 8y
0
still doesnt work SmxkePurpp 50 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Fixed here is the script:


local tool = script.Parent local Player = game.Players.LocalPlayer local mouse = Player:GetMouse() tool.Equipped:connect(function() tool.Activated:connect(function(Mine) if mouse.Target == game.Workspace.Rock or game.Workspace.Rock or game.Workspace.Rock or game.Workspace.Rock or game.Workspace.Rock or game.Workspace.Rock or game.Workspace.Rock or game.Workspace.Rock or game.Workspace.Rock or game.Workspace.Rock or game.Workspace.Rock then mouse.Target.Ore:Destroy() return Mine elseif mouse.Target ~= game.Workspace.Rock then return Mine end end) end)
Ad

Answer this question