Roblox Studio and game experience crash and crash and crash because of one script, help

Hello, in my game players can transform themselves into morphs, in these morphs I add Motor6D in order to realize animations with certain objects, as soon as the Motor6D arrive on the player, the game crashes, if it is in game the player receives an error message “Your connection was lost blah blah blah” and if it is in Studio there is written “StartProcessException…” then the studio crashs. If someone can help me… Thanks

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		wait(3)
		if not plr.Character:FindFirstChild('ChienChat') then
			if not plr.Character.RightFoot:FindFirstChild('ToolGrip') then 
				local Motor = Instance.new('Motor6D')
				Motor.Parent = char.LeftFoot
				Motor.Name = "ToolGrip"
				local Motor2 = Instance.new('Motor6D')
				Motor2.Parent = char.RightFoot
				Motor2.Name = "ToolGrip"	
			end
		else --HERE BUG
			local Motor = Instance.new('Motor6D')
			Motor.Parent = char.LeftFoot
			Motor.Name = "ToolGrip2"
			local Motor2 = Instance.new('Motor6D')
			Motor2.Parent = char.RightFoot
			Motor2.Name = "ToolGrip2"
            local Motor3 = Instance.new('Motor6D')
			Motor3.Parent = char.LeftFoot2
			Motor3.Name = "ToolGrip2"
			local Motor4 = Instance.new('Motor6D')
			Motor4.Parent = char.RightFoot2
			Motor4.Name = "ToolGrip2"
		end
	end)
end)
1 Like

in the second time you create the toolgrip you dont check if they already have a toolgrip and they probably do and roblox crashes (when it shouldnt) because there are two grips

Nop unfortunatly it doesn’t fix the issue .

then i dont know what could be causing it. maybe a different script is making this happen?

This is a post related to your issue:

No it’s not an another script because if i remove theses lines then everything work :

else --HERE BUG
			local Motor = Instance.new('Motor6D')
			Motor.Parent = char.LeftFoot
			Motor.Name = "ToolGrip2"
			local Motor2 = Instance.new('Motor6D')
			Motor2.Parent = char.RightFoot
			Motor2.Name = "ToolGrip2"
            local Motor3 = Instance.new('Motor6D')
			Motor3.Parent = char.LeftFoot2
			Motor3.Name = "ToolGrip2"
			local Motor4 = Instance.new('Motor6D')
			Motor4.Parent = char.RightFoot2
			Motor4.Name = "ToolGrip2"
		end

Yes I have already seen this post unfortunately it doesn’t help me much, I searched a lot before asking the question

1 Like

Animation Event Crashing Game solution