Got it after tossing in a bunch of wait()s (and removing the else's to remove complications) now i gotta just figure out which wait() did it and why this part was causing issues. Thanks!!!
mouse.Button1Down:Connect(function()
***** ButtonDown = true *****
while ButtonDown do
if ready == true then
local p = mouse.Target
if p.Locked == false and (p.Position - Tool.Parent.Head.Position).Magnitude < 15 then
ready = false
local Data = {Part = mouse.Target, Color = ColorSelection}
ServerControls:InvokeServer("PaintPart", Data)
wait(1)
ready = true
else
end
else end
end
end)
mouse.Button1Up:Connect(function()
ButtonDown = false
end)
Basically this is part of a painting script. It was going fine until I tried to add in a cooldown. The cooldown works when the player continues to hold down the mouse, but if they attempt to double click, theres an error from the starred line.
I'm just a bit confused where this is going wrong. Does anyone have advise?
Thanks!

3 comments
I would also advise to not use the
elseclause if there is nothing after it, you have alot of "else end" and it just makes the code messy, just leave it with an end :)You also don't need to check if a boolean value is true by doing "if bool == true then", all you need to do is "if bool then"
ah ok I didnt realize. Thank you and sorry for my messiness in anything I put up here haha I've just learned from messing around with others' scripts which often arent the best