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

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:

01--LocalScript
02local player = game.Players.LocalPlayer
03local Mouse = player:GetMouse()
04local Mining = false
05local Strength = player.Strength
06function Xplo()
07    Mouse.Target.Xplo.Enabled = true
08    wait(0.1)
09    Mouse.Target.Xplo.Enabled = false
10end
11 
12Mouse.Button1Down:connect(function()
13    Mining = true
14    while true do
15        wait(0.1)
View all 42 lines...
0
Are there any errors when you play the game in Roblox Studio? cfiredog 274 — 7y
0
You don't know what `Mouse.Target` is yet! Check it prior to attempting to manipulate it. Goulstem 8144 — 7y
0
No errors. Have you also read the wiki about Mouse.Target? It is the object the mouse is pointing to. I am pointing to a part that has every single one of these things. TinyScripter 70 — 7y
0
I dont get what you mean and what the point of the script does VenomiZeD_VamqireXz 111 — 7y
0
So then your not a scripter TinyScripter 70 — 7y

Answer this question