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
01--Variables
02local Player = game.Players.LocalPlayer
03local mouse = Player:GetMouse()
04 
05--Mining
06mouse.Button1Down(function()
07    if mouse.Target == nil then return end
08    if mouse.Target == 'Rock'  then
09        mouse.Target.Ore:remove()
10    end
11end)
12 
13mouse.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:

01local tool = script.Parent
02local Player = game.Players.LocalPlayer
03local mouse = Player:GetMouse()
04 
05 
06tool.Equipped:connect(function()
07    tool.Activated:connect(function(Mine)
08        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
09            mouse.Target.Ore:Destroy()
10            return Mine
11        elseif mouse.Target ~= game.Workspace.Rock then
12            return Mine
13        end
14    end)
15end)
Ad

Answer this question