I am making a mining script and it is supposed to run when the player presses Button1, but nothing happens. Here is the script:
--LocalScript local player = game.Players.LocalPlayer local Mouse = player:GetMouse() local Mining = false local Strength = player.Strength function Xplo() Mouse.Target.Xplo.Enabled = true wait(0.1) Mouse.Target.Xplo.Enabled = false end Mouse.Button1Down:connect(function() Mining = true while true do wait(0.1) if Mining == true then Mouse.Target.Durability.Value = Mouse.Target.Durability.Value - Strength Mouse.Target.Break.Durabilty.Visible = true if Mouse.Target.Durability.Value <= 0 then local Dropz = Mouse.Target.Drop.Value Mouse.Target.BottomImage:Destroy() Mouse.Target.FrontImage:Destroy() Mouse.Target.BackImage:Destroy() Mouse.Target.LeftImage:Destroy() Mouse.Target.RightImage:Destroy() Mouse.Target.TopImage:Destroy() Mouse.Target.Transparency = 1 Xplo() local Item = game.ServerStorage.Dropz:Clone() local pos = Mouse.Target.Position Item.Position = Vector3.new(pos) Mouse.Target:Destroy() end end end end) Mouse.Button1Up:connect(function() Mining = false Mouse.Target.Durability.Value = Mouse.Target.FirstDura.Value Mouse.Target.Break.Durabilty.Visible = false end)