Animation markers being repeated?

How you doin’? So I’ve come across a weird problem where an animation marker is being repeated after each call. For example, after it’s 1st call it runs once. After it’s 18th call it runs 18 times. I know this because it gets printed out 18 times even tho it should only be run once after it’s 18th call. Here’s the code:

SigTrack:GetMarkerReachedSignal("start"):Connect(function()
	print("sigtrack Started")
	local Lightning = Effects.Lightning:Clone()
	Lightning.Name = "QEffect"
	Lightning.Parent = Character.UpperTorso
		
	Humanoid.WalkSpeed = 0
	Humanoid.JumpPower = 0
		
	tool.BodyAttach.lightningSound:Play()
end)

SigTrack:GetMarkerReachedSignal("end"):Connect(function()
	print("Sig track stopped")
	local FindQEffect = Character.UpperTorso:FindFirstChild("QEffect")
	if FindQEffect then
		FindQEffect:Destroy()
	end
	Humanoid.WalkSpeed = 16
	Humanoid.JumpPower = 50
	canSigHit = false
	animationTraffic = false
end)

Additionally, this is what the output would look like:

pressed Q

(Server)pressed Q

sigtrack Started

pressed Q

(Server)pressed Q

Sig track stopped (x2)

Sig track stopped

pressed Q

(Server)pressed Q

sigtrack Started (x3)

pressed Q

(Server)pressed Q

Sig track stopped (x4)

Sig track stopped

pressed Q

(Server)pressed Q

sigtrack Started (x5)

Sig track stopped (x5)

Sig track stopped

Many thanks for actually taking the time to read this! :slight_smile:

1 Like

Solved it. I’ve been wrapping it around a event which was making it repeat.

1 Like

I’m curious what the entire script looks like because I too am having this problem but cannot find out what’s making it repeat each time.