This answer assumes you have basic knowledge of tools and their events
Hello Lodok3. :p
The problem with your tool's that each time the tools equipped, it's going to keep creating a new loop. You never set anything up to stop the one prior. Lines 27-37 yield this.
while wait(0.01) do
while m == true do
workspace.Events.AddPoints:FireServer()
wait(2)
end
end
One solution can to be to instead put the second loop (while m == true do) inside the Button1Down event. An example of this would be;
...Button1Down:Connect(function()
MouseDown = true
while MouseDown do
end
end)
...Button1Up:Connect(function()
MouseDown = false
end)
However, another problem arises: when the player unequips! :O Nps though, we got this covered. :p We can detect when a player unequips a tool via the Unequipped event of a tool, and so from there, when it fires, we change MouseDown to false.
Tool.Unequipped:Connect(function()
MouseDown = false
end)
If you have any questions, feel free to ask. :)
I hope this helped! :D
3 comments
Why is a repeat until loop better than a while loop.
Also you did not answer the question
I thought his problem was his while wait() do never ended so I recommended him to change the loop but maybe I communicated wrong?