Help with studio crashing

I tried to make a simple sword script but i already crashed my game with a local script

Atk = script.Parent.Activated:Connect(function()
	local AC1 = humanoid:LoadAnimation(script.Parent.AC1)
	AC1:Play()
	local T1
	T1 = H1.Touched:Connect(function(Part)
		local PHum = Part.Parent:FindFirstChild("Humanoid")
		if PHum then
			RE.AC1:FireServer(PHum,9)
			Atk:Disconnect()
			T1:Disconnect()
		end
	end)
	wait(3)
	Atk:Disconnect()
end)

funny thing is the remoteevent is not even connected to anything but i think it crashes the server?

anyways when i run this script the studio either crashes instantly or gives the crash pop-up.

help would be appreciated!!!

Any errors in the Output Window?

Why not have
local T1 = the following line?

What’s H1?
T1 = H1.Touched:Connect(function(Part)

I also think you need to load the animation before the function, so it’s ready to go and doesn’t have to be loaded every single time the function is called.

You can troubleshoot by putting print statements like print(T1) or print(PHum) in each function and loop so you can see where the error output is.

turns out i used the new curver editor feature for the animation editor.
thats why it kept crashing!