How to get this script to run code when Mouse.Button1Down and Mining == true?
Asked by
7 years ago Edited 7 years ago
I am making a mining script and it is supposed to run when the player presses Button1, but nothing happens. Here is the script:
02 | local player = game.Players.LocalPlayer |
03 | local Mouse = player:GetMouse() |
05 | local Strength = player.Strength |
07 | Mouse.Target.Xplo.Enabled = true |
09 | Mouse.Target.Xplo.Enabled = false |
12 | Mouse.Button 1 Down:connect( function () |
16 | if Mining = = true then |
17 | Mouse.Target.Durability.Value = Mouse.Target.Durability.Value - Strength |
18 | Mouse.Target.Break.Durabilty.Visible = true |
19 | if Mouse.Target.Durability.Value < = 0 then |
20 | local Dropz = Mouse.Target.Drop.Value |
21 | Mouse.Target.BottomImage:Destroy() |
22 | Mouse.Target.FrontImage:Destroy() |
23 | Mouse.Target.BackImage:Destroy() |
24 | Mouse.Target.LeftImage:Destroy() |
25 | Mouse.Target.RightImage:Destroy() |
26 | Mouse.Target.TopImage:Destroy() |
27 | Mouse.Target.Transparency = 1 |
29 | local Item = game.ServerStorage.Dropz:Clone() |
30 | local pos = Mouse.Target.Position |
31 | Item.Position = Vector 3. new(pos) |
32 | Mouse.Target:Destroy() |
38 | Mouse.Button 1 Up:connect( function () |
40 | Mouse.Target.Durability.Value = Mouse.Target.FirstDura.Value |
41 | Mouse.Target.Break.Durabilty.Visible = false |