01 | --Variables |
02 | local Player = game.Players.LocalPlayer |
03 | local mouse = Player:GetMouse() |
04 |
05 | --Mining |
06 | mouse.Button 1 Down( function () |
07 | if mouse.Target = = nil then return end |
08 | if mouse.Target = = 'Rock' then |
09 | mouse.Target.Ore:remove() |
10 | end |
11 | end ) |
12 |
13 | mouse.Button 1 Down:connect() |
It will not remove the ore once i click.
Fixed here is the script:
01 | local tool = script.Parent |
02 | local Player = game.Players.LocalPlayer |
03 | local mouse = Player:GetMouse() |
04 |
05 |
06 | tool.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 ) |
15 | end ) |