I'm trying to make this script shorter to reduce lag (not much lag is added but it's still noticeable) but since I'm not super good at scripting I don't know of anyway.
local enabled = false
local cd = script.Parent.ClickDetector
function enabled()
enabled = true
script.Parent.Parent.GYSPA.PACERONE:Stop()
script.Parent.Parent.GYSPB.PACERONE:Stop()
script.Parent.Parent.GYSPC.PACERONE:Stop()
script.Parent.Parent.GYSPD.PACERONE:Stop()
script.Parent.Parent.GYSPE.PACERONE:Stop()
script.Parent.Parent.GYSPF.PACERONE:Stop()
script.Parent.Parent.GYSPG.PACERONE:Stop()
script.Parent.Parent.GYSPH.PACERONE:Stop()
script.Parent.Parent.GYSPA.PACERTWO:Stop()
script.Parent.Parent.GYSPB.PACERTWO:Stop()
script.Parent.Parent.GYSPC.PACERTWO:Stop()
script.Parent.Parent.GYSPD.PACERTWO:Stop()
script.Parent.Parent.GYSPE.PACERTWO:Stop()
script.Parent.Parent.GYSPF.PACERTWO:Stop()
script.Parent.Parent.GYSPG.PACERTWO:Stop()
script.Parent.Parent.GYSPH.PACERTWO:Stop()
script.Parent.Parent.GYSPA.PACERTHREE:Stop()
script.Parent.Parent.GYSPB.PACERTHREE:Stop()
script.Parent.Parent.GYSPC.PACERTHREE:Stop()
script.Parent.Parent.GYSPD.PACERTHREE:Stop()
script.Parent.Parent.GYSPE.PACERTHREE:Stop()
script.Parent.Parent.GYSPF.PACERTHREE:Stop()
script.Parent.Parent.GYSPG.PACERTHREE:Stop()
script.Parent.Parent.GYSPH.PACERTHREE:Stop()
script.Parent.Parent.GYSPA.PACERFOUR:Stop()
script.Parent.Parent.GYSPB.PACERFOUR:Stop()
script.Parent.Parent.GYSPC.PACERFOUR:Stop()
script.Parent.Parent.GYSPD.PACERFOUR:Stop()
script.Parent.Parent.GYSPE.PACERFOUR:Stop()
script.Parent.Parent.GYSPF.PACERFOUR:Stop()
script.Parent.Parent.GYSPG.PACERFOUR:Stop()
script.Parent.Parent.GYSPH.PACERFOUR:Stop()
end
function disabled()
enabled = false
script.Parent.Parent.GYSPA.PACERONE:Play()
script.Parent.Parent.GYSPB.PACERONE:Play()
script.Parent.Parent.GYSPC.PACERONE:Play()
script.Parent.Parent.GYSPD.PACERONE:Play()
script.Parent.Parent.GYSPE.PACERONE:Play()
script.Parent.Parent.GYSPF.PACERONE:Play()
script.Parent.Parent.GYSPG.PACERONE:Play()
script.Parent.Parent.GYSPH.PACERONE:Play()
wait(script.Parent.Parent.GYSPA.PACERONE.TimeLength)
script.Parent.Parent.GYSPA.PACERTWO:Play()
script.Parent.Parent.GYSPB.PACERTWO:Play()
script.Parent.Parent.GYSPC.PACERTWO:Play()
script.Parent.Parent.GYSPD.PACERTWO:Play()
script.Parent.Parent.GYSPE.PACERTWO:Play()
script.Parent.Parent.GYSPF.PACERTWO:Play()
script.Parent.Parent.GYSPG.PACERTWO:Play()
script.Parent.Parent.GYSPH.PACERTWO:Play()
wait(script.Parent.Parent.GYSPA.PACERTWO.TimeLength)
script.Parent.Parent.GYSPA.PACERTHREE:Play()
script.Parent.Parent.GYSPB.PACERTHREE:Play()
script.Parent.Parent.GYSPC.PACERTHREE:Play()
script.Parent.Parent.GYSPD.PACERTHREE:Play()
script.Parent.Parent.GYSPE.PACERTHREE:Play()
script.Parent.Parent.GYSPF.PACERTHREE:Play()
script.Parent.Parent.GYSPG.PACERTHREE:Play()
script.Parent.Parent.GYSPH.PACERTHREE:Play()
wait(script.Parent.Parent.GYSPA.PACERTHREE.TimeLength)
script.Parent.Parent.GYSPA.PACERFOUR:Play()
script.Parent.Parent.GYSPB.PACERFOUR:Play()
script.Parent.Parent.GYSPC.PACERFOUR:Play()
script.Parent.Parent.GYSPD.PACERFOUR:Play()
script.Parent.Parent.GYSPE.PACERFOUR:Play()
script.Parent.Parent.GYSPF.PACERFOUR:Play()
script.Parent.Parent.GYSPG.PACERFOUR:Play()
script.Parent.Parent.GYSPH.PACERFOUR:Play()
end
function onClicked()
if enabled == true then disabled() else enabled() end
end
cd.MouseClick:connect(onClicked)
enabled()
It would mean a lot to me if you could help, thanks.

19 comments
Is it sounds or animations that it's stopping?
Sounds
https://developer.roblox.com/articles/Roblox-Coding-Basics-Loops
U Simply Cant
Ah man, I was going to say that.
you got a lot of answers to choose from
poor op, 7 answers xddd
Eight now.
nine now, lets hit double digits lol
8
How did this question ever spark this much attention lol
Prefect Scripting Question does not exi-
Why did y'all get creative with the answers?
12
I went off to go to sleep and I come back to this lol, these answers are hilarous
choose an answer
Captain alien is famous, Choose an answer captain, be even more famous ;o
Wait what even is a gysph